XX-net/XX-Net · warning
request not supported command mode:%d
Error message
request not supported command mode:%d
What it means
SOCKS5 request handler received a command code other than 1 (TCP CONNECT); e.g. BIND(2) or UDP ASSOCIATE(3). It replies 0x05 0x07 (command not supported) and closes.
Source
Thrown at code/default/x_tunnel/local/proxy_handler.py:244
auth_mode_num = ord(self.read_bytes(1))
data = self.read_bytes(auth_mode_num)
sock.send(b"\x05\x00") # socks version 5, no auth needed.
try:
data = self.read_bytes(4)
except Exception as e:
xlog.debug("socks5 auth num:%d, list:%s", auth_mode_num, utils.str2hex(data))
xlog.warn("socks5 protocol error:%r", e)
return
socks_version = ord(data[0:1])
if socks_version != 5:
xlog.warn("request version:%d error", socks_version)
return
command = ord(data[1:2])
if command != 1: # 1. Tcp connect
xlog.warn("request not supported command mode:%d", command)
sock.send(b"\x05\x07\x00\x01") # Command not supported
return
addrtype_pack = data[3:4]
addrtype = ord(addrtype_pack)
if addrtype == 1: # IPv4
addr_pack = self.read_bytes(4)
addr = socket.inet_ntoa(addr_pack)
elif addrtype == 3: # Domain name
domain_len_pack = self.read_bytes(1)[0:1]
domain_len = ord(domain_len_pack)
domain = self.read_bytes(domain_len)
addr_pack = domain_len_pack + domain
addr = domain
elif addrtype == 4: # IPv6
addr_pack = self.read_bytes(16)
addr = socket.inet_ntop(socket.AF_INET6, addr_pack)
else:View on GitHub (pinned to cfa5bc17b6)
Solutions
- Disable UDP/UDP-relay in the client or force TCP DNS
- Use a SOCKS5 server with UDP support for such traffic
- Ignore for plain browsing — TCP CONNECT covers it
Defensive patterns
Strategy: validation
Validate before calling
if command != 1: client_must_use_tcp_connect()
Prevention
- Disable UDP relay in SOCKS clients
- Force TCP DNS in client config
When it happens
Trigger: SOCKS5 client sending BIND or UDP ASSOCIATE, commonly DNS-over-proxy (port 53 UDP) or WebRTC traffic.
Common situations: Browsers/apps trying UDP via socks5 (e.g. 'socks5h' with DNS through proxy done via TCP is fine, but explicit UDP fails).
Related errors
- request not supported command mode:%d
- do_unwrap_socks connect to x-tunnel for %s:%d proxy fail.
- Socks4 cmd:%d not supported
- request address type unknown:%d
- socks5 create conn to %s:%d fail
AI-assisted analysis of XX-net/XX-Net@cfa5bc17b6 (2026-08-27).
Data as JSON: /api/errors/809649991c8efdf1.
Report an issue: GitHub.