Last active
October 13, 2015 12:18
-
-
Save zvving/4194658 to your computer and use it in GitHub Desktop.
使用此 pac 方便的在 OS X 中配置 ssh 代理
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 ssh1 = 'SOCKS5 192.168.10.10:1080;SOCKS 192.168.10.10:1080'; | |
var exp1 = [ | |
'*youtube*', | |
'*facebook*', | |
'*google*', | |
'*ytimg.com/*', | |
'*fbcdn.net/*', | |
'*git-scm.com/*', | |
'*pixnet.net/*', | |
'*fb.me*', | |
'*blogger*', | |
'*Blogger*', | |
'*Wikipedia*', | |
'*fastly.net*', | |
'*vagrantup*', | |
'*keyremap4macbook*', | |
'*redtube.com*', | |
'*mobile01*', | |
'*.tw/*', | |
'*github.com*', | |
'*mobile01.com*', | |
'*trello.com*', | |
'*simplenote.com*', | |
'*amazonaws.com*', | |
'*getpocket.com*', | |
'*gstatic.com/*', | |
'*slideshare.net/*', | |
'*bit.ly/*', | |
'*dillinger.io/*', | |
'*dropbox.com/*', | |
'*twitter.com/*', | |
'*.twimg.com/*', | |
'*blogspot.com/*', | |
'*googleusercontent.com/*', | |
'*.vimeo.com/*', | |
'*t.co/*', | |
'*.wordpress.com/*', | |
'*doubleclick.net/*' | |
]; | |
for(var i in exp1) { | |
if (shExpMatch(url, exp1[i])) { | |
return ssh1; | |
} | |
} | |
return 'DIRECT'; | |
} |
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 ssh1 = 'SOCKS 192.168.10.10:1080'; | |
var exp1 = [ | |
'*youtube*', | |
'*facebook*', | |
'*google*', | |
'*ytimg.com/*', | |
'*fbcdn.net/*', | |
'*git-scm.com/*', | |
'*fb.me*', | |
'*blogger*', | |
'*Blogger*', | |
'*Wikipedia*', | |
'*fastly.net*', | |
'*vagrantup*', | |
'*keyremap4macbook*', | |
'*redtube.com*', | |
'*mobile01*', | |
'*.tw/*', | |
'*github.com*', | |
'*mobile01.com*', | |
'*trello.com*', | |
'*.phobos.apple.com/*', | |
'*.akadns.net/*', | |
'*simplenote.com*', | |
'*amazonaws.com*', | |
'*getpocket.com*', | |
'*gstatic.com/*', | |
'*slideshare.net/*', | |
'*bit.ly/*', | |
'*dillinger.io/*', | |
'*dropbox.com/*', | |
'*twitter.com/*', | |
'*.twimg.com/*', | |
'*blogspot.com/*', | |
'*googleusercontent.com/*', | |
'*.vimeo.com/*', | |
'*t.co/*', | |
'*.wordpress.com/*', | |
'*doubleclick.net/*' | |
]; | |
for(var i in exp1) { | |
if (shExpMatch(url, exp1[i])) { | |
return ssh1; | |
} | |
} | |
return 'DIRECT'; | |
} |
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 ssh1 = 'SOCKS5 127.0.0.1:1080;SOCKS 127.0.0.1:1080'; | |
var exp1 = [ | |
'*youtube*', | |
'*facebook*', | |
'*google*', | |
'*ytimg.com/*', | |
'*fbcdn.net/*', | |
'*git-scm.com/*', | |
'*fb.me*', | |
'*blogger*', | |
'*Blogger*', | |
'*Wikipedia*', | |
'*fastly.net*', | |
'*vagrantup*', | |
'*keyremap4macbook*', | |
'*redtube.com*', | |
'*mobile01*', | |
'*.tw/*', | |
'*simplenote.com*', | |
'*amazonaws.com*', | |
'*getpocket.com*', | |
'*gstatic.com/*', | |
'*slideshare.net/*', | |
'*bit.ly/*', | |
'*dillinger.io/*', | |
'*dropbox.com/*', | |
'*twitter.com/*', | |
'*.twimg.com/*', | |
'*blogspot.com/*', | |
'*googleusercontent.com/*', | |
'*.vimeo.com/*', | |
'*t.co/*', | |
'*.wordpress.com/*', | |
'*doubleclick.net/*' | |
]; | |
for(var i in exp1) { | |
if (shExpMatch(url, exp1[i])) { | |
return ssh1; | |
} | |
} | |
return 'DIRECT'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment