{"record":{"id":"95c4de2b62145413","repo":"XX-net/XX-Net","slug":"request-not-supported-command-mode-d","errorCode":null,"errorMessage":"request not supported command mode:%d","messagePattern":"request not supported command mode:(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"code/default/smart_router/local/proxy_handler.py","lineNumber":291,"sourceCode":"            domain_len_pack = self.read_bytes(1)[0:1]\n            domain_len = ord(domain_len_pack)\n            domain = self.read_bytes(domain_len)\n            addr_pack = domain_len_pack + domain\n            addr = domain\n        elif addrtype == 4:  # IPv6\n            addr_pack = self.read_bytes(16)\n            addr = socket.inet_ntop(socket.AF_INET6, addr_pack)\n        else:\n            xlog.warn(\"request address type unknown:%d\", addrtype)\n            sock.send(b\"\\x05\\x07\\x00\\x01\")  # Command not supported\n            return\n        port = struct.unpack('>H', self.rfile.read(2))[0]\n\n        if command == 3:  # 3. UDP associate\n            return self.handle_udp_associate(sock, addr, port, addrtype_pack, addr_pack)\n\n        if command != 1:  # 1. Tcp connect\n            xlog.warn(\"request not supported command mode:%d\", command)\n            sock.send(b\"\\x05\\x07\\x00\\x01\")  # Command not supported\n            return\n\n        # xlog.debug(\"socks5 %r connect to %s:%d\", self.client_address, addr, port)\n        reply = b\"\\x05\\x00\\x00\" + addrtype_pack + addr_pack + struct.pack(\">H\", port)\n        sock.send(reply)\n\n        if addrtype in [1, 4]:\n            handle_ip_proxy(sock, addr, port, self.client_address)\n        else:\n            handle_domain_proxy(sock, addr, port, self.client_address)\n\n    def https_handler(self):\n        line = self.read_crlf_line()\n        line = line\n        words = line.split()\n        if len(words) == 3:\n            command, path, version = words","sourceCodeStart":273,"sourceCodeEnd":309,"githubUrl":"https://github.com/XX-net/XX-Net/blob/cfa5bc17b67676e467f37ec50766127e0ab5f0aa/code/default/smart_router/local/proxy_handler.py#L273-L309","documentation":"SOCKS5 CONNECT-stage command was neither 1 (TCP connect) nor 3 (UDP associate). The proxy replies 0x07 command not supported and returns.","triggerScenarios":"SOCKS5 client issues CMD 0x02 (BIND) at the request stage.","commonSituations":"FTP active mode, some P2P or remote-admin clients requesting BIND through SOCKS5.","solutions":["Configure the client to use CONNECT-only mode / passive transfers","Use SOCKS5 UDP associate if UDP is the actual need","Choose a proxy implementation that supports BIND if the app requires it"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if command not in (1,3): send 0x07 reply and close","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Avoid SOCKS BIND through this proxy","Use UDP associate for UDP needs"],"tags":["socks5","protocol","unsupported-command"],"backgroundTag":"socks-command-not-supported","analyzedSha":"cfa5bc17b67676e467f37ec50766127e0ab5f0aa","analyzedAt":"2026-08-27T19:28:28.225Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}