XX-net/XX-Net · warning

socks version:%s not supported

Error message

socks version:%s not supported

What it means

The SOCKS/HTTP multiplexed listener read a first byte that is neither a SOCKS5 greeting (\x05), SOCKS4 code, 'C' (CONNECT) nor a plain HTTP method letter, so the connection is dropped with this warning.

Source

Thrown at code/default/x_tunnel/local/proxy_handler.py:61

    def handle(self):
        self.__class__.handle_num += 1
        try:
            socks_version = self.read_bytes(1)
            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(socks_version)
                return
            else:
                xlog.warn("socks version:%s not supported",  utils.str2hex(socks_version))
                return

        except socket.error as e:
            xlog.warn('proxy handler read error %r', e)
            self.connection.close()
        except Exception as e:
            xlog.exception("proxy handler err:%r", e)
            self.connection.close()

    def read_null_end_line(self):
        sock = self.connection
        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 + 1

View on GitHub (pinned to cfa5bc17b6)

Solutions

  1. Point your client at the correct local proxy port with SOCKS5 or HTTP mode
  2. If health checks cause it, exclude the proxy port from probing
  3. Ignore — the handler closes the socket safely
Defensive patterns

Strategy: validation

Validate before calling

first = sock.recv(1)
if first not in (b'\x05', b'\x04', b'C', b'G', b'P', b'D', b'O', b'H', b'T'):
    sock.close()

Prevention

When it happens

Trigger: Connecting a non-SOCKS/non-HTTP client to the local x-tunnel proxy port, or sending garbage/binary before a valid greeting.

Common situations: Wrong port used (e.g. pointing an SMTP or arbitrary TCP client at the proxy), or a health-checker probing the port.

Related errors


AI-assisted analysis of XX-net/XX-Net@cfa5bc17b6 (2026-08-27). Data as JSON: /api/errors/5508a2835678462a. Report an issue: GitHub.