Skip to content

Instantly share code, notes, and snippets.

function FindProxyForURL(url, host) {
// Local addresses - direct connection
if (isPlainHostName(host) ||
isInNet(host, "192.168.0.0", "255.255.255.0") ||
host == "127.0.0.1") {
return "DIRECT";
}
// Use SOCKS5 for specific protocols and sites (better for P2P, torrents, etc.)
if (shExpMatch(url, "*.torrent") ||