TorProxy-Client is a simple Python library to connect to the internet through the Tor network using a proxy. It helps developers easily route their traffic through the Tor network to achieve better anonymity.
- Connect to the internet through Tor's SOCKS5 proxy
- Easy integration with Python applications
- Configurable proxy settings
- Support for both local and remote Tor nodes
Before using TorProxy-Client, you need to have Tor installed on your system. Below are the installation instructions for different platforms:
-
Install Scoop if you haven't already.
-
Install Tor using the following command:
scoop install tor
Alternatively, you can download the official Tor Browser from the Tor Project website, which will also install the Tor service.
- Ensure that the Tor service is running by checking that the Tor process is active in the task manager or using tor.exe.
-
Install Homebrew if you haven't already.
-
Install Tor using the following command:
brew install tor- Start Tor with the following command:
tor- Ensure the Tor service is running by checking for the process using ps aux | grep tor
For most Linux distributions, you can install Tor via the package manager.
- Update your package list and install Tor:
sudo apt update
sudo apt install tor- Start the Tor service:
sudo systemctl start tor
- Enable Tor to start on boot:
sudo systemctl enable tor
Fedora
- Install Tor using the following command:
sudo dnf install tor- Start the Tor service:
sudo systemctl start tor- Enable Tor to start on boot:
sudo systemctl enable tor
- Install Tor using the following command:
sudo pacman -S tor- Start the Tor service:
sudo systemctl start tor- Enable Tor to start on boot:
sudo systemctl enable torTo install TorProxy-Client, use pip:
pip install torproxy_clientOnce installed, you can use TorProxy-Client to configure your application to route traffic through the Tor network.
from torproxy_client import TorProxyClient
import requests
# Initialize the Tor proxy client
proxy = TorProxyClient()
# Check if Tor connection is successful
if proxy.tor_initialize():
print("Tor connection successful!")
else:
print("Tor connection failed. Please check if the Tor service is running.")
# Request via Tor
url = "https://check.torproject.org"
response = requests.get(url)
print(response.text)