Skip to content

Instantly share code, notes, and snippets.

@yuba
Created June 11, 2014 03:59
Show Gist options
  • Select an option

  • Save yuba/d9a0c895b81b4a610619 to your computer and use it in GitHub Desktop.

Select an option

Save yuba/d9a0c895b81b4a610619 to your computer and use it in GitHub Desktop.
社内ネットにつないだときだけプロクシ設定をオンにする ref: http://qiita.com/yuba/items/2840f913194732a30bd4
function FindProxyForURL(url,host)
{
if ( isPlainHostName(host)
|| shExpMatch(host, "172.16.*")
|| shExpMatch(host, "172.17.*")
|| shExpMatch(host, "172.18.*")
|| shExpMatch(host, "172.19.*")
|| shExpMatch(host, "172.2?.*")
|| shExpMatch(host, "172.30.*")
|| shExpMatch(host, "172.31.*")
|| shExpMatch(host, "10.*")
|| shExpMatch(host, "192.168.*")
|| shExpMatch(host, "127.0.0.*")
|| shExpMatch(host,"*.example.co.jp"))
return "DIRECT";
else return "PROXY proxyserver:8080";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment