https://github.com/nlitsme/pytorify
module which makes sure all sockets use the TOR proxy
https://github.com/nlitsme/pytorify
python tor tor-proxy
Last synced: 4 months ago
JSON representation
module which makes sure all sockets use the TOR proxy
- Host: GitHub
- URL: https://github.com/nlitsme/pytorify
- Owner: nlitsme
- License: mit
- Created: 2016-08-24T12:49:06.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-05-02T13:49:18.000Z (about 9 years ago)
- Last Synced: 2025-09-22T20:44:22.249Z (9 months ago)
- Topics: python, tor, tor-proxy
- Language: Python
- Size: 8.79 KB
- Stars: 6
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pytorify
Module which makes sure all sockets use the TOR proxy at port 9050
This module works with both python2 and python3.
When using this module:
* Name lookups are blocked.
* No UDP traffic is possible.
* All TCP traffic is redirected through tor.
## Requirements
* PySocks
* TOR, with socks5 proxy at localhost, port 9050
The original [SocksiPy (1.0.0)](http://socksipy.sourceforge.net/) module is no longer being maintained,
there are several forks, like [PySocks 1.5.7 By Anorov](https://github.com/Anorov/PySocks).
## Usage
`torify` can be used either in two ways, either loaded from the
python commandline using the `-m` switch. Or as a imported module.
### From the commandline:
python -mtorify [options] yourmodule.py [...with args...]
Several options can be passed to `torify`:
--proxy PROXY, -p PROXY Where to find the TOR socks5 proxy
--nocheck, -n Skip TOR connection check
By default `torify` uses 127.0.0.1:9050 as the socks proxy for TOR.
### As a module
import torify
torify.use_tor_proxy()
optionally you can call these function to configure the tor proxy.
torify.set_tor_proxy("127.0.0.1", 9150) # use tor from TorBrowser
torify.disable_tor_check()
## TODO
* instead of blocking name lookups, resolve names using socks namelookup.
## AUTHOR
Willem Hengeveld