Python Forum
Socks 5 Proxy Server For UDP ASSOCIATE
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Socks 5 Proxy Server For UDP ASSOCIATE
#1
I want Help in Developing Socks5 Based Proxy Server For TCP and UDP Support.
I am able to build it for TCP but facing issue for UDP....
Reply
#2
To build a Socks5 based proxy server for TCP and UDP support, you can use the SOCKS5 protocol1. The SOCKS5 protocol provides support for UDP. A client wishing to relay UDP packets through a SOCKS5 server must open a TCP connection to the SOCKS5 server and send a UDP ASSOCIATE request. The server then returns the address and port where it must send UDP packets to be relayed.

Here is an example of how to create a Socks 5 proxy server for TCP and UDP in Python 3:

# Create new UDP socket and send/receive data
udp_sock = socket.socket (socket.AF_INET, socket.SOCK_DGRAM)
udp_sock.connect ((target_addr, int.from_bytes (target_port, 'big')))
while True:
    data, addr = udp_sock.recvfrom (4096)
    data = handle_udp (udp_sock, data)
    sock.sendto (data, addr)
buran write Jun-13-2023, 11:07 AM:
Spam Link removed
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Paramiko Server -- Exception (server): Error reading SSH protocol banner ujlain 3 4,631 Jul-24-2023, 06:52 AM
Last Post: Gribouillis
  http server whit proxy jrcruz 0 2,555 Feb-13-2019, 10:02 AM
Last Post: jrcruz

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020