Last active
January 28, 2026 09:18
-
-
Save zhouyl/aec209965181d4e6a368 to your computer and use it in GitHub Desktop.
Proxy.pac
This file contains hidden or 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) { | |
| var PROXY = "SOCKS5 10.1.2.79:8600; DIRECT;"; | |
| var DIRECT = "DIRECT"; | |
| var list = [ | |
| '*t.co*', | |
| '*twitter.com*', | |
| '*twimg.com*', | |
| '*tinypic.com*', | |
| '*twitpic.com*', | |
| '*bitly.com*', | |
| '*yfrog.com*', | |
| '*youtube.com*', | |
| '*facebook.com*', | |
| '*appspot.com*', | |
| '*dropbox.com*', | |
| '*flickr.com*', | |
| '*google.com*', | |
| '*ggpht.com*', | |
| '*hzmangel.info*', | |
| '*slideshare.net*', | |
| '*vimeo.com*', | |
| '*wordpress.com*', | |
| '*malsup.com*', | |
| '*jsfiddle.net*', | |
| '*phalconphp.com*', | |
| '*codeplex.com*', | |
| '*gavatar.com*', | |
| '*github.com*', | |
| '*github.io*' | |
| ]; | |
| for(var i=0; i<list.length; i++) { | |
| if (shExpMatch(url, list[i])) { | |
| return PROXY; | |
| } | |
| } | |
| if ( | |
| // 主机名中没有 "." | |
| isPlainHostName(host) || | |
| // 主机可解析 | |
| isResolvable(host) || | |
| // 如果主机在子网中 | |
| isInNet(dnsResolve(host), "10.1.0.0", "255.255.255.0") || | |
| isInNet(dnsResolve(host), "192.168.0.0", "255.255.255.0") || | |
| isInNet(dnsResolve(host), "127.0.0.0", "255.255.255.0") | |
| ) { | |
| return DIRECT; | |
| } | |
| return PROXY; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment