{"record":{"id":"03cc2565f7a1e2b4","repo":"XX-net/XX-Net","slug":"set-lan-proxy-to-s-d-fail","errorCode":null,"errorMessage":"set LAN Proxy to %s:%d fail.","messagePattern":"set LAN Proxy to (.+?):(.+?) fail\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"code/default/launcher/web_control.py","lineNumber":1021,"sourceCode":"\n            dat += \"thread num:%d<br>\" % threading.active_count()\n\n            self.send_response(\"text/plain\", dat)\n        except Exception as e:\n            xlog.exception(\"debug:%r\", e)\n            self.send_response(\"text/html\", \"no mem_top\")\n\n\nmem_stat = None\n\n\ndef test_proxy(type, host, port, user, passwd):\n    if not host:\n        return False\n\n    if host == \"127.0.0.1\":\n        if port in [8087, 1080, 8086]:\n            xlog.warn(\"set LAN Proxy to %s:%d fail.\", host, port)\n            return False\n\n    client = simple_http_client.Client(proxy={\n        \"type\": type,\n        \"host\": host,\n        \"port\": int(port),\n        \"user\": user if len(user) else None,\n        \"pass\": passwd if len(passwd) else None\n    }, timeout=3)\n\n    urls = [\n        \"https://www.microsoft.com\",\n        \"https://www.apple.com\",\n        \"https://code.jquery.com\",\n        \"https://cdn.bootcss.com\",\n        \"https://cdnjs.cloudflare.com\"]\n\n    for url in urls:","sourceCodeStart":1003,"sourceCodeEnd":1039,"githubUrl":"https://github.com/XX-net/XX-Net/blob/cfa5bc17b67676e467f37ec50766127e0ab5f0aa/code/default/launcher/web_control.py#L1003-L1039","documentation":"Sanity check in test_proxy(): setting a LAN/Local proxy to 127.0.0.1 on one of XX-Net's own ports (8087 HTTP proxy, 1080 socks, 8086 smart router) would create a loop, so it refuses with False and this warning.","triggerScenarios":"User configures the system/LAN proxy (in the config UI's proxy test) to 127.0.0.1:8087/1080/8086 — pointing XX-Net at itself.","commonSituations":"Copy-pasting XX-Net's own listen port into the 'check proxy' fields; cascading proxy setups after port reconfiguration.","solutions":["Use an external proxy host/port, not 127.0.0.1 on XX-Net's own ports.","If chaining is intended, run the upstream proxy on a different port/address.","Leave LAN proxy empty when XX-Net is the endpoint proxy."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if host == '127.0.0.1' and int(port) in (8087, 1080, 8086):\n    raise ValueError('proxy points at XX-Net itself')","typeGuard":"def is_self_proxy(host, port):\n    return host == '127.0.0.1' and int(port) in (8087, 1080, 8086)","tryCatchPattern":null,"preventionTips":["Use external upstream proxies only.","Don't paste XX-Net's own listen ports into proxy settings.","Leave LAN proxy empty unless chaining is intended."],"tags":["proxy","configuration","loop","localhost"],"backgroundTag":"proxy-self-reference","analyzedSha":"cfa5bc17b67676e467f37ec50766127e0ab5f0aa","analyzedAt":"2026-08-27T19:28:28.225Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}