From 409e90c510999dedc5338ed6638f73a1b76907e6 Mon Sep 17 00:00:00 2001 From: Juan Camilo Date: Wed, 1 Apr 2026 17:05:45 +0200 Subject: [PATCH] fix: use correct default port for wss:// in NO_PROXY matching The proxy bypass logic assigned port 80 to any non-https protocol, including wss:// whose default port is 443. A NO_PROXY entry like example.com:443 would not match wss://example.com because the port was incorrectly resolved to 80. Relates to #40 Co-Authored-By: Juan Camilo --- src/utils/proxy.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/proxy.ts b/src/utils/proxy.ts index 39880231..24c7e488 100644 --- a/src/utils/proxy.ts +++ b/src/utils/proxy.ts @@ -97,7 +97,9 @@ export function shouldBypassProxy( try { const url = new URL(urlString) const hostname = url.hostname.toLowerCase() - const port = url.port || (url.protocol === 'https:' ? '443' : '80') + const port = url.port || ( + url.protocol === 'https:' || url.protocol === 'wss:' ? '443' : '80' + ) const hostWithPort = `${hostname}:${port}` // Split by comma or space and trim each entry