Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function FindProxyForURL(url, host)
- {
- //Pass localhost traffic directly
- if ((host == "localhost") ||(shExpMatch(host, "localhost.*")) ||(host == "127.0.0.1")) {
- return "DIRECT";
- }
- //Pass local network traffic directly
- if (shExpMatch(host, "/^\d+\.\d+\.\d+\.\d+$/g")) {
- if (isInNet(host, "10.0.0.0", "255.0.0.0") {
- return "DIRECT";}
- }
- //Test what it is seeing as local IP address
- if ((host =="proxy.mfrl.org")) {
- alert("Local IP address is: " + myIpAddress());
- }
- //Hostname without DNS Pass Directly
- if (isPlainHostName(host)){
- return "DIRECT";
- }
- //Proxy Server for Blacksburg Staff
- if (isInNet(myIpAddress(), "10.10.100.0", "255.255.255.0")){
- return "PROXY 10.10.100.12:8080";
- }
- ///Proxy Server for Christiansburg Staff
- if (isInNet(myIpAddress(), "10.10.110.0", "255.255.255.0")){
- return "PROXY 10.10.110.12:8080";
- }
- //Proxy Server for Floyd Staff
- if (isInNet(myIpAddress(), "10.10.120.0", "255.255.255.0")){
- return "PROXY 10.10.120.12:8080";
- }
- //Proxy Server for MPL Staff
- if (isInNet(myIpAddress(), "10.10.130.0", "255.255.255.0")){
- return "PROXY 10.10.130.12:8080";
- }
- //Proxy Server for Blacksburg Public
- if (isInNet(myIpAddress(), "10.30.100.0", "255.255.255.0")){
- return "PROXY 10.30.100.12:8080";
- }
- //Proxy Server for Christiansburg Public
- if (isInNet(myIpAddress(), "10.30.110.0", "255.255.255.0")){
- return "PROXY 10.30.110.12:8080";
- }
- //Proxy Server for Floyd Public
- if (isInNet(myIpAddress(), "10.30.120.0", "255.255.255.0")){
- return "PROXY 10.30.120.12:8080";
- }
- //Proxy Server for MPL Public
- if (isInNet(myIpAddress(), "10.30.130.0", "255.255.255.0")){
- return "PROXY 10.30.130.12:8080";
- }
- else
- return "DIRECT";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement