function DomainIs(host, domain) { return (host == domain) || (host.substring(host.length - domain.length - 1) == '.' + domain); } function FindProxyForURL(url, host) { if (DomainIs(host, 'i2p')) { return 'PROXY 127.0.0.1:4444'; } if (DomainIs(host, 'onion')) { return 'SOCKS5 127.0.0.1:9050'; } if (DomainIs(host, 'googlevideo.com') || DomainIs(host, 'netflix.com') || DomainIs(host, 'nflxvideo.net') || DomainIs(host, 'twitch.tv') || DomainIs(host, 'vimeo.com') || DomainIs(host, 'youtube.com') || DomainIs(host, 'ytimg.com')) { return 'SOCKS5 proxy.0x00ff00ff.com:1080'; } return 'DIRECT'; }