{"record":{"id":"4dbbb36474200719","repo":"XX-net/XX-Net","slug":"proxy-setting-r","errorCode":null,"errorMessage":"proxy_setting:%r","messagePattern":"proxy_setting:%r","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"code/default/launcher/win_tray.py","lineNumber":52,"sourceCode":"        self.systray = SysTrayIcon(icon_path, app_name, self.make_menu(), self.on_quit, left_click=self.on_show, right_click=self.on_right_click)\n\n        reg_path = r'Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings'\n        self.INTERNET_SETTINGS = winreg.OpenKey(winreg.HKEY_CURRENT_USER, reg_path, 0, winreg.KEY_ALL_ACCESS)\n\n        proxy_setting = config.os_proxy_mode\n        if proxy_setting == \"pac\":\n            self.on_enable_pac()\n        elif proxy_setting == \"gae\" and config.enable_gae_proxy == 1:\n            self.on_enable_gae_proxy()\n        elif proxy_setting == \"x_tunnel\" and config.enable_x_tunnel == 1:\n            self.on_enable_x_tunnel()\n        elif proxy_setting == \"smart_router\" and config.enable_smart_router == 1:\n            self.on_enable_smart_router()\n        elif proxy_setting == \"disable\":\n            # Don't disable proxy setting, just do nothing.\n            pass\n        else:\n            xlog.warn(\"proxy_setting:%r\", proxy_setting)\n\n    def get_proxy_state(self):\n        try:\n            AutoConfigURL, reg_type = winreg.QueryValueEx(self.INTERNET_SETTINGS, 'AutoConfigURL')\n            if AutoConfigURL:\n                if AutoConfigURL == \"http://127.0.0.1:8086/proxy.pac\":\n                    return \"pac\"\n                else:\n                    return \"unknown\"\n        except:\n            pass\n\n        try:\n            ProxyEnable, reg_type = winreg.QueryValueEx(self.INTERNET_SETTINGS, 'ProxyEnable')\n            if ProxyEnable:\n                ProxyServer, reg_type = winreg.QueryValueEx(self.INTERNET_SETTINGS, 'ProxyServer')\n                if ProxyServer == \"127.0.0.1:8087\":\n                    return \"gae\"","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/XX-net/XX-Net/blob/cfa5bc17b67676e467f37ec50766127e0ab5f0aa/code/default/launcher/win_tray.py#L34-L70","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\n# launcher.ini\nproxy_setting = auto\n\n// after\n# launcher.ini\nproxy_setting = pac\n# or: proxy_setting = smart_router  (with enable_smart_router = 1)","handlingStrategy":"type-guard","validationCode":"VALID = {'pac', 'smart_router', 'disable'}\nif proxy_setting not in VALID:\n    xlog.warn('unknown proxy_setting %r; defaulting to pac', proxy_setting)\n    proxy_setting = 'pac'","typeGuard":"def is_valid_proxy_setting(v):\n    return v in ('pac', 'smart_router', 'disable')","tryCatchPattern":null,"preventionTips":["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."],"tags":["windows","configuration","proxy","tray","launcher"],"backgroundTag":"invalid-enum-config-value","analyzedSha":"cfa5bc17b67676e467f37ec50766127e0ab5f0aa","analyzedAt":"2026-08-27T19:28:28.225Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}