Simple library to manage tor proxy and IP changes
Project description
tor-python-easy
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.
- First one is using docker and docker-compose from this repo. You can manipulate with mapping
ports and password.
docker-compose up
- Second one uses tor installed in OS
tor --controlport 9051
Use lib with python
-
In terminal
docker-compose up
-
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
Built Distribution
File details
Details for the file tor-python-easy-0.1.4.tar.gz
.
File metadata
- Download URL: tor-python-easy-0.1.4.tar.gz
- Upload date:
- Size: 2.9 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | fddf64e0f059f10a11dba5b300156b4b6f38efc574c1aff103832a5d75fa3dac |
|
MD5 | 68c17732b37fe61a8464db397bb8be43 |
|
BLAKE2b-256 | a08c33ac74da134f83ff2763e6042c2f13e56eeb04253245b4408f50f46b0a63 |
File details
Details for the file tor_python_easy-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: tor_python_easy-0.1.4-py3-none-any.whl
- Upload date:
- Size: 3.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4571704f05bea1b465bbf2fd516295781668d1740c0133ede96f1dfd34aafcf |
|
MD5 | 21ab81df7a7558a0d775f4e5d1ba067b |
|
BLAKE2b-256 | 77812a306c57b00f8c7ed203509d8b93d0a439652ae0d9dd1aa56482ae7e0717 |