Here is the code that I still have
import socks
import socket
import requests
import json
socks.setdefaultproxy(proxy_type=socks.PROXY_TYPE_SOCKS5, addr="127.0.0.1", port=9050)
socket.socket = socks.socksocket
data = json.loads(requests.get("http://freegeoip.net/json/").text)
and it works great. The problem is that when I use the URL .onionit shows an error
Failed to establish a new connection: [Errno -2] Name or service unknown
After a little research, I found that although the HTTP request was made over tor, the permission still extends to clearnet. What is the correct way, so I can also allow the domain allowed through the network to connect to the .onionurls?
source
share