Spinlab - The resource hub Content Scripts [Python3] Script to check SOCKS5 proxies for UDP support

[Python3] Script to check SOCKS5 proxies for UDP support

[Python3] Script to check SOCKS5 proxies for UDP support

RazoR
Administrator
4
03-19-2026, 01:36 PM
#1
Working on a project that required to communicate via UDP and have proxied connections (via UDP too) I asked Claude AI to write me a python3 script that would parse a list of SOCKS5 proxies and would check + save into a file all the proxies that support UDP (UDP association for SOCKS5).
The script was made only for SOCKS5 protocol and worked very well in finding proxies that support UDP.
Also, one thing that I came across, UDP proxies are pretty rare and after parsing a list of over 500000 IPs, only a few had UDP support enabled (a list of the proxies found is here: https://github.com/Deiow/SOCKS5-Proxy-Ch...roxies.txt).

The script can be found on Github -> https://github.com/Deiow/SOCKS5-Proxy-Ch...ks5_udp.py

One more thing regarding this script, in order to validate that the UDP support is really working the script also sends a packet via the proxy to a destination address that must communicate via UDP.
Code:

# Target server for testing
TARGET_HOST = "ip"
TARGET_PORT = port

# UDP message
UDP_MESSAGE = 'Hello world!'

The test is done via function test_udp():
Code:

def test_udp(self) -> bool:
        """Send Source Engine query and wait for response"""
        try:
            # Build and send UDP packet
            udp_packet = self.build_udp_packet(UDP_MESSAGE)
            self.udp_sock.sendto(udp_packet, (self.udp_relay_ip, self.udp_relay_port))

            # Wait for response
            try:
                data, addr = self.udp_sock.recvfrom(4096)
                return True
            except socket.timeout:
                return False

        except Exception:
            return False

If this validation check is not ok, then the proxy is discarded and not saved into the output file.
RazoR
03-19-2026, 01:36 PM #1

Working on a project that required to communicate via UDP and have proxied connections (via UDP too) I asked Claude AI to write me a python3 script that would parse a list of SOCKS5 proxies and would check + save into a file all the proxies that support UDP (UDP association for SOCKS5).
The script was made only for SOCKS5 protocol and worked very well in finding proxies that support UDP.
Also, one thing that I came across, UDP proxies are pretty rare and after parsing a list of over 500000 IPs, only a few had UDP support enabled (a list of the proxies found is here: https://github.com/Deiow/SOCKS5-Proxy-Ch...roxies.txt).

The script can be found on Github -> https://github.com/Deiow/SOCKS5-Proxy-Ch...ks5_udp.py

One more thing regarding this script, in order to validate that the UDP support is really working the script also sends a packet via the proxy to a destination address that must communicate via UDP.

Code:

# Target server for testing
TARGET_HOST = "ip"
TARGET_PORT = port

# UDP message
UDP_MESSAGE = 'Hello world!'

The test is done via function test_udp():
Code:

def test_udp(self) -> bool:
        """Send Source Engine query and wait for response"""
        try:
            # Build and send UDP packet
            udp_packet = self.build_udp_packet(UDP_MESSAGE)
            self.udp_sock.sendto(udp_packet, (self.udp_relay_ip, self.udp_relay_port))

            # Wait for response
            try:
                data, addr = self.udp_sock.recvfrom(4096)
                return True
            except socket.timeout:
                return False

        except Exception:
            return False

If this validation check is not ok, then the proxy is discarded and not saved into the output file.

Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)