Skip to content

Instantly share code, notes, and snippets.

@angeloped
Last active December 19, 2021 15:23
Show Gist options
  • Save angeloped/0b6356facd0da913e66054cd543e43d2 to your computer and use it in GitHub Desktop.
Save angeloped/0b6356facd0da913e66054cd543e43d2 to your computer and use it in GitHub Desktop.
Client request on .onion domains through TOR proxy.
import socks
import socket
host = 'ifconfig.me'
host = 'libraryqtlpitkix.onion'
socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "127.0.0.1", 9050, True)
s = socks.socksocket()
s.connect((host, 80))
message = "GET / HTTP/1.1\r\nHost: {0}\r\n\r\n".format(host)
s.sendall(message)
reply = s.recv(9069)
print reply
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment