fix: faulty auto-detect proxy on Windows
Massimo Melina committed
Sep 13, 2025 at 13:56 UTC
591ff7d6981b4cc224a486e2a065cd543e8035a9
1 file changed
+2
-2
src/outboundProxy.ts
+2
-2
@@ -24,8 +24,8 @@ configReady.then(async ([startedWithoutConfig]) => {
24
if (!IS_WINDOWS || !startedWithoutConfig) return
25
// try to read Windows system setting for proxy
26
const out = await reg('query', 'HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings')
27
- if (!/ProxyEnable.+(\d)/.exec(out)?.[1]) return
28
- const read = /ProxyServer.+?([\d:.]+)/.exec(out)?.[1]
27
+ if (!Number(/ProxyEnable\s+\w+\s+(.+)/.exec(out)?.[1])) return
28
+ const read = /ProxyServer\s+\w+\s+(.+)/.exec(out)?.[1]
29
if (!read) return
30
// it can be like "IP:PORT" or "http=IP:PORT;https=IP:PORT;ftp=IP:PORT"
31
const url = prefix('https://', /https=([\d:.]+)/.exec(out)?.[1]) // prefer https