Skip to content

Commit

Permalink
Added PAC script path for DIRECT after failed proxies.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmoinvaz committed Dec 5, 2022
1 parent 8fae689 commit 71613c6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions test/pac.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@ function FindProxyForURL(url, host) {
return "DIRECT";
}
// Explicit port numbers are needed to prevent default to 80.
// On Windows, WinHTTP does not like whitespace after semi-colons.
if (host == "simple.com") {
return "PROXY no-such-proxy:80";
} else if (host == "multi.com") {
return "HTTPS some-such-proxy:443; HTTPS any-such-proxy:41";
// Return proxy list with Firefox proxy types.
return "HTTPS some-such-proxy:443;HTTPS any-such-proxy:41";
} else if (host == "multi-legacy.com") {
// Older implementations don't support HTTP/HTTPS/SOCKS prefixes.
return "PROXY some-such-proxy:443; PROXY any-such-proxy:41";
// Older implementations don't support HTTP/HTTPS/SOCKS proxy types.
return "PROXY some-such-proxy:443;PROXY any-such-proxy:41";
} else if (host == "multi-legacy-direct.com") {
// Connect using direct connection if no proxy is available.
return "PROXY some-such-proxy:443;PROXY any-such-proxy:41;DIRECT";
}
return "DIRECT";
}

0 comments on commit 71613c6

Please sign in to comment.