Skip to main content

A simple Python library to connect to the internet through Tor proxy.

Project description

License PyPI version Publish to PyPI Python Version

TorProxy-Client

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.

Features

  • 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

Prerequisites

Before using TorProxy-Client, you need to have Tor installed on your system. Below are the installation instructions for different platforms:

Windows

  1. Install Scoop if you haven't already.

  2. 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.

  1. Ensure that the Tor service is running by checking that the Tor process is active in the task manager or using tor.exe.

macOS

  1. Install Homebrew if you haven't already.

  2. Install Tor using the following command:

brew install tor
  1. Start Tor with the following command:
tor
  1. Ensure the Tor service is running by checking for the process using ps aux | grep tor

Linux

For most Linux distributions, you can install Tor via the package manager.

Ubuntu/Debian

  1. Update your package list and install Tor:
sudo apt update
sudo apt install tor
  1. Start the Tor service:
sudo systemctl start tor
  1. Enable Tor to start on boot:
sudo systemctl enable tor

Fedora

  1. Install Tor using the following command:
sudo dnf install tor
  1. Start the Tor service:
sudo systemctl start tor
  1. Enable Tor to start on boot:
sudo systemctl enable tor

Arch Linux

  1. Install Tor using the following command:
sudo pacman -S tor
  1. Start the Tor service:
sudo systemctl start tor
  1. Enable Tor to start on boot:
sudo systemctl enable tor

Installation

To install TorProxy-Client, use pip:

pip install torproxy_client

Usage

Once 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)

Dependencies

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

torproxy_client-0.1.3.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

torproxy_client-0.1.3-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file torproxy_client-0.1.3.tar.gz.

File metadata

  • Download URL: torproxy_client-0.1.3.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for torproxy_client-0.1.3.tar.gz
Algorithm Hash digest
SHA256 a16934d98f07ec034a115d2e3c40599693cf5d2a7f0e7ceb215b2394b956658c
MD5 72d53c3116b6fdf95777da95015a6b8f
BLAKE2b-256 b64991d9aa8feda2d7bd1e0ae562d7cf79b6153b2fececcd1a3fd6c7f2129e0b

See more details on using hashes here.

File details

Details for the file torproxy_client-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for torproxy_client-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8db4615854d566de275c28983d9a54e793e70457cc732d967f817ad194802d14
MD5 b5788f7d13d436a3aa91ba5d0e51eb04
BLAKE2b-256 992b23f8eaf440182fd06095bcb254c9eaded946ba2aaeedeb9a5bbb2d91e80c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page