Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function FindProxyForURL(url, host)
- {
- #$OldProxy = "PROXY KOM-AD01-TMG.holding.com:8080";
- $NewProxy = "ZEPTO.mlvz.local:3128";
- #$TestProxy = "PROXY KOM-AD01-TEST.holding.com:3128";
- //
- // URLs for localhost
- if (shExpMatch(host, "127.0.0.1" )) {return "DIRECT";}
- if (shExpMatch(host, "*/localhost*" )) {return "DIRECT";}
- //
- // Local sites by IP
- if (isInNet(host, "192.168.91.0", "255.255.255.0")) {return "DIRECT";}
- //
- // If URL has no dots in host name, send traffic direct4
- if (isPlainHostName(host)) {return "DIRECT";}
- //
- // URLs mathing mask - single host URLs in some domain
- if (shExpMatch(url, "*/app1.local2.com*")) {return "DIRECT";}
- if (shExpMatch(url, "*/portal.sub-local.su*")) {return "DIRECT";}
- if (shExpMatch(url, "*/test-billing.holding.com*")) {return $NewProxy;}
- //
- // URLs mathing mask - all URLs in some domain
- if (shExpMatch(url,"*mlvz.local*")) {return "DIRECT";}
- if (shExpMatch(url, "*sygroup.local*")) {return "DIRECT";}
- if (shExpMatch(url,"*.sygroup-east.local*")) {return "DIRECT";}
- //
- // Testing clients
- #if (isInNet(myIpAddress(), "10.160.100.20", "255.255.255.255")) {return $TestProxy;}
- #if (isInNet(myIpAddress(), "10.160.200.15", "255.255.255.255")) {return $TestProxy;}
- //
- // Clients for new proxy
- if (isInNet(myIpAddress(), "192.168.91.0", "255.255.255.0")) {return $NewProxy;}
- //
- //Return old proxy for EVERYTHING
- return $OldProxy;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement