XX-net/XX-Net · warning
socks version:%s[%s] not supported
Error message
socks version:%s[%s] not supported
What it means
The first byte read from an incoming connection did not match any known protocol signature: 0x05 (SOCKS5), 0x04 (SOCKS4), 'C' (CONNECT/HTTPS), or HTTP method initials (G/P/D/O/H/T). The handler drops the request.
Source
Thrown at code/default/smart_router/local/proxy_handler.py:81
if not self.try_redirect():
self.handle_request()
def handle_request(self):
try:
socks_version = self.conn.recv(1, socket.MSG_PEEK)
if not socks_version:
return
if socks_version == b"\x04":
self.socks4_handler()
elif socks_version == b"\x05":
self.socks5_handler()
elif socks_version == b"C":
self.https_handler()
elif socks_version in [b"G", b"P", b"D", b"O", b"H", b"T"]:
self.http_handler()
else:
xlog.warn("socks version:%s[%s] not supported", socks_version, utils.str2hex(socks_version))
return
except socket.error as e:
xlog.warn('socks handler read error:%r', e)
self.conn.close()
except Exception as e:
xlog.exception("any err:%r", e)
self.conn.close()
def read_null_end_line(self):
sock = self.conn
sock.setblocking(0)
try:
while True:
n1 = self.read_buffer.find(b"\x00", self.buffer_start)
if n1 > -1:
line = self.read_buffer[self.buffer_start:n1]
self.buffer_start = n1 + 1View on GitHub (pinned to cfa5bc17b6)
Solutions
- Check what the client actually sends (the hex dump in the message) and fix the client protocol/port
- Ensure the client uses SOCKS5/SOCKS4/HTTP CONNECT as supported by this proxy
- Filter health-check/scanner traffic hitting the proxy port
- Do not point raw TCP apps at the proxy listener
Defensive patterns
Strategy: validation
Validate before calling
assert first_byte in (b'\x05', b'\x04', b'C', b'G', b'P', b'D', b'O', b'H', b'T') before dispatching
Type guard
def is_supported_protocol(b): return b in {b'\x05', b'\x04'} or chr(b[0]) in 'CGPDOHT' Prevention
- Point protocol-correct clients at the proxy port
- Document supported protocols per port
When it happens
Trigger: Pointing a non-proxy client at the local proxy port, sending garbage/bytes before a protocol handshake, or an ASCII protocol whose first byte is not in the recognized set.
Common situations: Sending plain HTTP to a SOCKS-only port configuration mismatch, port scanners, health probes, or misconfigured browser proxy settings.
Related errors
- https req line fail:%s
- socks version:%s not supported
- 600
- proxy handler read error %r
- roundtrip time:%f transfer_no:%d send:%d recv:%d unpack_erro
AI-assisted analysis of XX-net/XX-Net@cfa5bc17b6 (2026-08-27).
Data as JSON: /api/errors/e987c6023f1d242e.
Report an issue: GitHub.