XX-net/XX-Net · info
proxy_setting:%r
Error message
proxy_setting:%r
What it means
In WinTray's __init__, the configured proxy_setting value matched none of the known cases (pac, or smart_router when enabled, or 'disable'), so the tray logs the unrecognized value and leaves the proxy state untouched. It is purely informational: no exception is thrown and startup continues.
Source
Thrown at code/default/launcher/win_tray.py:52
self.systray = SysTrayIcon(icon_path, app_name, self.make_menu(), self.on_quit, left_click=self.on_show, right_click=self.on_right_click)
reg_path = r'Software\Microsoft\Windows\CurrentVersion\Internet Settings'
self.INTERNET_SETTINGS = winreg.OpenKey(winreg.HKEY_CURRENT_USER, reg_path, 0, winreg.KEY_ALL_ACCESS)
proxy_setting = config.os_proxy_mode
if proxy_setting == "pac":
self.on_enable_pac()
elif proxy_setting == "gae" and config.enable_gae_proxy == 1:
self.on_enable_gae_proxy()
elif proxy_setting == "x_tunnel" and config.enable_x_tunnel == 1:
self.on_enable_x_tunnel()
elif proxy_setting == "smart_router" and config.enable_smart_router == 1:
self.on_enable_smart_router()
elif proxy_setting == "disable":
# Don't disable proxy setting, just do nothing.
pass
else:
xlog.warn("proxy_setting:%r", proxy_setting)
def get_proxy_state(self):
try:
AutoConfigURL, reg_type = winreg.QueryValueEx(self.INTERNET_SETTINGS, 'AutoConfigURL')
if AutoConfigURL:
if AutoConfigURL == "http://127.0.0.1:8086/proxy.pac":
return "pac"
else:
return "unknown"
except:
pass
try:
ProxyEnable, reg_type = winreg.QueryValueEx(self.INTERNET_SETTINGS, 'ProxyEnable')
if ProxyEnable:
ProxyServer, reg_type = winreg.QueryValueEx(self.INTERNET_SETTINGS, 'ProxyServer')
if ProxyServer == "127.0.0.1:8087":
return "gae"View on GitHub (pinned to cfa5bc17b6)
Solutions
- Set proxy_setting in the launcher config to one of the supported values: pac, smart_router, or disable.
- If you intended smart router, also set enable_smart_router = 1 so the elif branch matches.
- Add the new value to the if/elif chain in win_tray.py if you extended the config vocabulary.
- Treat this warning as benign if you intentionally use a custom value handled elsewhere.
Example fix
// before # launcher.ini proxy_setting = auto // after # launcher.ini proxy_setting = pac # or: proxy_setting = smart_router (with enable_smart_router = 1)
Defensive patterns
Strategy: type-guard
Validate before calling
VALID = {'pac', 'smart_router', 'disable'}
if proxy_setting not in VALID:
xlog.warn('unknown proxy_setting %r; defaulting to pac', proxy_setting)
proxy_setting = 'pac' Type guard
def is_valid_proxy_setting(v):
return v in ('pac', 'smart_router', 'disable') Prevention
- Validate config enums at load time and coerce to a default instead of silently passing them on.
- When adding new proxy_setting values, update every consumer (win_tray, launcher, config docs) in the same change.
- Pair smart_router with an explicit enable_smart_router check in config validation.
When it happens
Trigger: Passing a proxy_setting string other than 'pac'/'smart_router'/'disable' (e.g. 'auto', 'system', 'none', a typo, or 'smart_router' while config.enable_smart_router != 1) when constructing the WinTray object on Windows.
Common situations: Hand-edited launcher.ini with an invalid proxy_setting value; new/renamed setting values after an upgrade that the tray code doesn't know; smart_router selected but enable_smart_router set to 0.
Related errors
- set LAN Proxy to %s:%d fail.
- parse reserve port fail, line:%s, e:%r
- Can't found acceptable ports
- no appid
- time out
AI-assisted analysis of XX-net/XX-Net@cfa5bc17b6 (2026-08-27).
Data as JSON: /api/errors/4dbbb36474200719.
Report an issue: GitHub.