Use sockets to connect and download webpage of hidden service

Viewed 582
socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS4, "127.0.0.1", 9150, True)
socket = socks.socksocket()
socket.connect(('onionlink.onion', 80))
message = 'GET / HTTP/1.0\r\n\r\n'
socket.sendall(str.encode(message))
reply = socket.recv(4069)
print (reply)

This code works but the response is empty... The terminal prints this:

b''

Is there something wrong? How can I print the source of the hidden service?

1 Answers
Related