Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socks5 proxy for udp not comply with rfc1928? #155

Open
Humburto opened this issue Aug 29, 2021 · 1 comment
Open

Socks5 proxy for udp not comply with rfc1928? #155

Humburto opened this issue Aug 29, 2021 · 1 comment

Comments

@Humburto
Copy link

This is my simple script with PySocks:

import socks
import socket
s = socks.socksocket(socket.AF_INET, socket.SOCK_DGRAM)
s.set_proxy(socks.SOCKS5, "127.0.0.1", 9922) 
s.connect(("10.0.21.2", 20000))
s.sendall("HELLO".encode('utf-8'))
print(s.recv(4096))

As rfc1928 says, each UDP datagram must carries a UDP request header with it (on page 7). However, my socks5 server only received "HELLO" without any header. Is this some kind of bug of PySocks ? Or is there something wrong with my code?

@lilanleo
Copy link

try s.set_proxy(socket.SOCK_DGRAM, address, port)instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants