Skip to main content

Simple library to manage tor proxy and IP changes

Project description

tor-python-easy

Open Source Love CI Main PyPI version MIT Licence

tor-python-easy was developed for use tor proxy in python with easy interface, which allow for changing ip address whenever you want.

Repo is very simple but if you want you can add new feature request.

Donate

If you want to sponsor me, in thanks for the project, please send me some crypto 😁:

Coin Wallet address
Bitcoin 3EajE9DbLvEmBHLRzjDfG86LyZB4jzsZyg
Etherum 0xE43d8C2c7a9af286bc2fc0568e2812151AF9b1FD

Installation

Library is only one file, so you can copy it to project.

However, if you want you can install it with pip:

pip3 install tor-python-easy

Run tor proxy

There are two simple ways to run tor proxy.

  1. First one is using docker and docker-compose from this repo. You can manipulate with mapping ports and password.
    docker-compose up
    
  2. Second one uses tor installed in OS
    tor --controlport 9051 
    

Use lib with python

  1. In terminal

    docker-compose up
    
  2. In Python

    from tor_python_easy.tor_control_port_client import TorControlPortClient
    from tor_python_easy.tor_socks_get_ip_client import TorSocksGetIpClient
    
    if __name__ == '__main__':
        proxy_config = {
            'http': 'socks5://localhost:9050',
            'https': 'socks5://localhost:9050',
        }
        ip_client = TorSocksGetIpClient(proxy_config)
        tor_control_port_client = TorControlPortClient('localhost', 9051, 'test1234')
    
        for it in range(10):
            old_ip = ip_client.get_ip()
            tor_control_port_client.change_connection_ip(seconds_wait=10)
            new_ip = ip_client.get_ip()
            print(f'iteration {it + 1} ::  {old_ip} -> {new_ip}')
    

    Output will give 10 IP migrations.

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

tor-python-easy-0.1.5.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

tor_python_easy-0.1.5-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file tor-python-easy-0.1.5.tar.gz.

File metadata

  • Download URL: tor-python-easy-0.1.5.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.9.6 Linux/5.15.0-1014-azure

File hashes

Hashes for tor-python-easy-0.1.5.tar.gz
Algorithm Hash digest
SHA256 e4b0618b9a0bc8e3415cf68274af5f7759b96f37060a34377845624e9f1ab01d
MD5 8e4a450eed6528cd48b35504b8c3046d
BLAKE2b-256 3f498f849de8e3762ed4bee7100eb31355fdfa1ebd3c55806e1d32e1cd2edcf5

See more details on using hashes here.

File details

Details for the file tor_python_easy-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: tor_python_easy-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.9.6 Linux/5.15.0-1014-azure

File hashes

Hashes for tor_python_easy-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c154fa30e301fa8cf3b0f7563ec55bbc6abd54a57fccf6a96357ee3529b11aad
MD5 83059cdf146f15d5394ba29dbbfdcf38
BLAKE2b-256 8a323ec0dc2e722842f2eb7f74c1eb4de6ee3fb3629cdd3ac1f7a998d864de4b

See more details on using hashes here.

Supported by

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