Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var megafon_proxy = 1;
- var http_enabled = 1;
- var DIRECT = "DIRECT";
- var PROXY_HTTP = "DIRECT"; //
- var PROXY_SOCKS = "DIRECT"; //
- if (megafon_proxy) PROXY_HTTP = "PROXY 192.168.43.201:8888";
- //proxy list
- var gi, proxyListed = {}, proxyList = [];
- if (megafon_proxy) {
- proxyList.push("2ch.hk");
- }
- for (gi = 0; gi < proxyList.length; gi += 1)
- { proxyListed[proxyList[gi]] = true; }
- function hostToDomain(host) {
- var dotpos = host.lastIndexOf(".");
- if (dotpos === -1) { return host; }
- // Find the second last dot
- dotpos = host.lastIndexOf(".", dotpos - 1);
- if (dotpos === -1) { return host; }
- return host.substring(dotpos + 1);
- }
- function FindProxyForURL(url, host) {
- //checks host in antizapret, proxy lists, then select proxy type, else direct
- return (proxyListed[hostToDomain(host)] ? (http_enabled ? PROXY_HTTP : PROXY_SOCKS) : DIRECT);
- }
Add Comment
Please, Sign In to add comment