Skip to content

Instantly share code, notes, and snippets.

@davidcomfort
Created December 13, 2015 22:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidcomfort/9490609cf300b4d54711 to your computer and use it in GitHub Desktop.
Save davidcomfort/9490609cf300b4d54711 to your computer and use it in GitHub Desktop.
## NOTE: You have be connected to Tor for the command below to work
import socks
import socket
from urllib2 import urlopen
socks.set_default_proxy(socks.SOCKS5, "localhost", 9150)
socket.socket = socks.socksocket
print(urlopen('http://icanhazip.com').read())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment