XX-net/XX-Net · warning

set LAN Proxy to %s:%d fail.

Error message

set LAN Proxy to %s:%d fail.

What it means

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.

Source

Thrown at code/default/launcher/web_control.py:1021

            dat += "thread num:%d<br>" % threading.active_count()

            self.send_response("text/plain", dat)
        except Exception as e:
            xlog.exception("debug:%r", e)
            self.send_response("text/html", "no mem_top")


mem_stat = None


def test_proxy(type, host, port, user, passwd):
    if not host:
        return False

    if host == "127.0.0.1":
        if port in [8087, 1080, 8086]:
            xlog.warn("set LAN Proxy to %s:%d fail.", host, port)
            return False

    client = simple_http_client.Client(proxy={
        "type": type,
        "host": host,
        "port": int(port),
        "user": user if len(user) else None,
        "pass": passwd if len(passwd) else None
    }, timeout=3)

    urls = [
        "https://www.microsoft.com",
        "https://www.apple.com",
        "https://code.jquery.com",
        "https://cdn.bootcss.com",
        "https://cdnjs.cloudflare.com"]

    for url in urls:

View on GitHub (pinned to cfa5bc17b6)

Solutions

  1. Use an external proxy host/port, not 127.0.0.1 on XX-Net's own ports.
  2. If chaining is intended, run the upstream proxy on a different port/address.
  3. Leave LAN proxy empty when XX-Net is the endpoint proxy.
Defensive patterns

Strategy: validation

Validate before calling

if host == '127.0.0.1' and int(port) in (8087, 1080, 8086):
    raise ValueError('proxy points at XX-Net itself')

Type guard

def is_self_proxy(host, port):
    return host == '127.0.0.1' and int(port) in (8087, 1080, 8086)

Prevention

When it happens

Trigger: 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.

Common situations: Copy-pasting XX-Net's own listen port into the 'check proxy' fields; cascading proxy setups after port reconfiguration.

Related errors


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