Created
May 8, 2017 11:10
-
-
Save lai32290/f924387e2f4acfd64e9890468e1ef6f7 to your computer and use it in GitHub Desktop.
Ubuntu auto detect proxy pac config file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function FindProxyForURL(url, host) | |
{ | |
if (isInNet(myIpAddress(), "1.2.3.0", "255.255.255.0")) { | |
if (isInNet(host, "192.168.0.0", "255.255.0.0")) | |
return "DIRECT"; | |
if (shExpMatch(url, "http:*")) | |
return "PROXY my.proxy.com:8000" ; | |
if (shExpMatch(url, "https:*")) | |
return "PROXY my.proxy.com:8000" ; | |
if (shExpMatch(url, "ftp:*")) | |
return "PROXY my.proxy.com:8000" ; | |
return "DIRECT"; | |
} else { | |
return "DIRECT"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment