Merge pull request #51 from auriti/fix/proxy-wss-default-port

fix: use correct default port for wss:// in NO_PROXY matching
This commit is contained in:
Kevin Codex
2026-04-02 08:29:39 +08:00
committed by GitHub

View File

@@ -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