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 <juancamilo.auriti@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user