Created
May 11, 2011 10:01
-
-
Save d0ugal/966226 to your computer and use it in GitHub Desktop.
SOCKS Proxy
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
browsesecure() { | |
python <<SWITCH | |
import sys | |
from subprocess import Popen, call, PIPE | |
import time | |
def switch_location(name): | |
call(['scselect', name], stdout=open('/dev/null', 'w')) | |
print "Switched to %s" % name | |
switch_location('SOCK Proxied Public') | |
time.sleep(5) | |
print 'SOCKS Proxy on localhost:7890' | |
try: | |
call(['ssh', '-ND', '7890', 'xxx.xxx.xxx.xxx']) | |
except: | |
pass | |
finally: | |
switch_location("Automatic") | |
SWITCH | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment