Created
March 5, 2016 19:51
-
-
Save matrixfox/21d629e63fb099306df6 to your computer and use it in GitHub Desktop.
Revisions
-
matrixfox created this gist
Mar 5, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ import socket import socks import httplib def connectTor(): socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "127.0.0.1", 9050, True) socket.socket = socks.socksocket def main(): connectTor() print("Connected to tor") conn = httplib.HTTPConnection('www.cwi.nl', 80, timeout=10) conn.request("GET", "/") response = conn.getresponse() print(response.read()) if __name__ == "__main__": main()