Created
March 5, 2016 19:51
-
-
Save matrixfox/21d629e63fb099306df6 to your computer and use it in GitHub Desktop.
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
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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
YouTube: "Python TOR", THANKS!!! AcuteGaming