How do I configure a tor proxy on windows?
For example, I want to run the following python script through a tor proxy:
import requests
proxies = {
'http':'socks5h://localhost:9050',
'https':'socks5h:/localhost:9050'
}
url = 'someWebsite.onion'
res = requests.get(url, proxies=proxies)
On unix systems, you can simply run tor
in terminal, but this doesn't seem to work on windows.
Select the Start button, then select Settings > Network & Internet > VPN. Select the VPN connection, then select Advanced options. Under VPN proxy settings, select the type of proxy setup you want to use, then enter the proxy server information for that VPN connection.
What Is Tor? Tor is a free-to-use network of access points called nodes that work like proxies for your connection. It's also the name of the browser you use to connect to this network. When you use the Tor browser, your connection gets routed through several of these nodes before arriving at its end destination.
Go to the Preferences in Tor Browser. Select the Network Settings. See use the local IP address and port of the Tor network connection. These data must be inserted in the program Proxifier to the entire operating system, traffic was held in the Tor network.
navigate to \Tor Browser\Browser\TorBrowser\Data\Tor
and edit torcc file
# ControlPort 9051
SocksPort 9051
Then restart tor.
control panel -> network & internet -> internet options -> connection -> lan setting -> tick proxy server & goto advance & add:
proxy 127.0.0.1 port 9051
options -> network setting -> tick Manual proxy configuration & add:
proxy 127.0.0.1 port 9051
import requests
proxies = {
'http':'socks5://127.0.0.1:9051',
'https':'socks5:/127.0.0.1:9051'
}
url = 'https://check.torproject.org/'
res = requests.get(url, proxies=proxies)
Note: You have to keep running tor browser for this
Txtorcon and Stem are libraries developed by the Tor Project for controlling Tor from Python. Stem doesn't have any external dependencies. However, txtorcon allows one to launch Tor from Python, rather than just connect to a running instance.
Both of these libraries require a Tor binary already installed though. It is possible to use the Tor included with the Tor Browser Bundle, connecting on port 9150 (with control port of 9151).
Better yet though, you can download the "Expert Bundle" to get the Tor binary without any browser. The download for it is not currently linked from their new website, but the latest version can still be pulled from https://dist.torproject.org/torbrowser/. Navigate to a directory for either the alpha or stable version and search for "tor-win64-" (or "tor-win32-" if you need 32-bit).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With