https://github.com/fujiwarachoki/tor-demo
Demo on how to use TOR Proxies in Python.
https://github.com/fujiwarachoki/tor-demo
onion python stem tor
Last synced: 4 months ago
JSON representation
Demo on how to use TOR Proxies in Python.
- Host: GitHub
- URL: https://github.com/fujiwarachoki/tor-demo
- Owner: FujiwaraChoki
- License: apache-2.0
- Created: 2024-03-02T10:03:43.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-02T16:03:44.000Z (over 1 year ago)
- Last Synced: 2024-07-30T20:43:02.257Z (about 1 year ago)
- Topics: onion, python, stem, tor
- Language: Python
- Homepage:
- Size: 6.84 KB
- Stars: 10
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tor Demonstration in Python
This is a simple demonstration of how to use the Tor network in Python. This demonstration uses the `requests` library to make HTTP requests through the Tor network, and the `stem` library to control the Tor process.
## Installation
### Windows
1. Download and install the Tor Browser Bundle from [https://www.torproject.org/](https://www.torproject.org/).
2. Clone the repository and activate the virtual environment:```bash
git clone https://github.com/FujiwaraChokik/tor-demo.git
cd tor-demo
python -m venv .venv
.venv\Scripts\activate
```3. Install the required packages:
```bash
pip install -r requirements.txt
```### Linux
1. Install the Tor package:
```bash
sudo apt install tor
```2. Clone the repository and activate the virtual environment:
```bash
git clone https://github.com/FujiwaraChokik/tor-demo.git
cd tor-demo
python -m venv .venv
source .venv/bin/activate
```3. Install the required packages:
```bash
pip install -r requirements.txt
```## Note
Add this to your `torrc` file:
```bash
FetchDirInfoEarly 1
FetchDirInfoExtraEarly 1
FetchUselessDescriptors 1
DownloadExtraInfo 1
ControlPort 9051
SocksPort 9050
```## Usage
### Windows
1. Start the Tor Browser Bundle and click on the `Connect` button.
2. Run the script:```bash
python src/main.py
```### Linux
1. Start the Tor service:
```bash
sudo service tor start
```2. Run the script:
```bash
python src/main.py
```## License
This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
## Acknowledgments
- [https://stem.torproject.org/](https://stem.torproject.org/)
- [https://www.torproject.org/](https://www.torproject.org/)
- [https://requests.readthedocs.io/](https://requests.readthedocs.io/)