tor-proxy


Nametor-proxy JSON
Version 0.0.4 PyPI version JSON
download
home_pagehttps://github.com/jakbin/tor-proxy
SummaryA simple way to send your requests with tor using tor-proxy.
upload_time2025-07-09 17:15:10
maintainerNone
docs_urlNone
authorJak Bin
requires_python>=3
licenseMIT License
keywords flask tor onion stem proxy tor-proxy
VCS
bugtrack_url
requirements stem
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Tor-Proxy

A simple way to send your requests with tor using tor-proxy.It doesn’t interfere with other tor processes on your computer, so you can use the Tor Browser or the system tor on their own.

 [![PyPI version](https://badge.fury.io/py/tor-proxy.svg)](https://badge.fury.io/py/tor-proxy)
 [![Downloads](https://pepy.tech/badge/tor-proxy/month)](https://pepy.tech/project/tor-proxy)
 [![Downloads](https://static.pepy.tech/personalized-badge/tor-proxy?period=total&units=international_system&left_color=green&right_color=blue&left_text=Total%20Downloads)](https://pepy.tech/project/tor-proxy)
 ![Python 3.6](https://img.shields.io/badge/python-3.6-yellow.svg)


### Disclaimer:-
Use it only for educational purpose.

## Features
- No need root permission
- Multiple instances

## Compatability
Python 3.6+ is required.

## Installation

```bash
pip install tor-proxy
```

## Quickstart

1. Import with ```from tor_proxy import tor_proxy``` .
2. call function `tor_proxy()` , store as variable and give it as port argument in proxies.

```python
# tor_proxy_example.py
from tor_proxy import tor_proxy
import requests

port = tor_proxy()

http_proxy  = f"socks5h://127.0.0.1:{port}"
https_proxy = f"socks5h://127.0.0.1:{port}"

proxies = { 
              "http"  : http_proxy, 
              "https" : https_proxy, 
            }

url = "https://api.ipify.org"

r = requests.get(url, proxies=proxies)

print(r.text)
```

## Command Line Usage

After installing, you can run the Tor proxy service directly from the command line:

```bash
tor-proxy
```

This will start the Tor SOCKS proxy and print the port it is running on.

```sh
$ tor-proxy
connecting_to_tor: 100% - Done
Tor SOCKS proxy running on port: 47863
```

### Additional Command Line Options

- Run as a background (detached) process:

  ```bash
  tor-proxy --detach
  ```
  This will start the Tor proxy in the background.

- Kill all running Tor processes started with `/usr/bin/tor -f /tmp/...`:

  ```bash
  tor-proxy --kill
  ```
  This will find and terminate all matching Tor processes.

Now you can use this port as proxy in code.

```python
# tor_proxy_example.py
import requests

port = 47863

http_proxy  = f"socks5h://127.0.0.1:{port}"
https_proxy = f"socks5h://127.0.0.1:{port}"

proxies = { 
              "http"  : http_proxy, 
              "https" : https_proxy, 
            }

url = "https://api.ipify.org"

r = requests.get(url, proxies=proxies)

print(r.text)
```

### Credit :- [onionshare](https://github.com/onionshare/onionshare)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/jakbin/tor-proxy",
    "name": "tor-proxy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3",
    "maintainer_email": null,
    "keywords": "flask, tor, onion, stem, proxy, tor-proxy",
    "author": "Jak Bin",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/91/02/d6ae85501ba0b87f6079055d1b47278ed809243f78b3a3243a2497d8fee0/tor_proxy-0.0.4.tar.gz",
    "platform": null,
    "description": "# Tor-Proxy\n\nA simple way to send your requests with tor using tor-proxy.It doesn\u2019t interfere with other tor processes on your computer, so you can use the Tor Browser or the system tor on their own.\n\n [![PyPI version](https://badge.fury.io/py/tor-proxy.svg)](https://badge.fury.io/py/tor-proxy)\n [![Downloads](https://pepy.tech/badge/tor-proxy/month)](https://pepy.tech/project/tor-proxy)\n [![Downloads](https://static.pepy.tech/personalized-badge/tor-proxy?period=total&units=international_system&left_color=green&right_color=blue&left_text=Total%20Downloads)](https://pepy.tech/project/tor-proxy)\n ![Python 3.6](https://img.shields.io/badge/python-3.6-yellow.svg)\n\n\n### Disclaimer:-\nUse it only for educational purpose.\n\n## Features\n- No need root permission\n- Multiple instances\n\n## Compatability\nPython 3.6+ is required.\n\n## Installation\n\n```bash\npip install tor-proxy\n```\n\n## Quickstart\n\n1. Import with ```from tor_proxy import tor_proxy``` .\n2. call function `tor_proxy()` , store as variable and give it as port argument in proxies.\n\n```python\n# tor_proxy_example.py\nfrom tor_proxy import tor_proxy\nimport requests\n\nport = tor_proxy()\n\nhttp_proxy  = f\"socks5h://127.0.0.1:{port}\"\nhttps_proxy = f\"socks5h://127.0.0.1:{port}\"\n\nproxies = { \n              \"http\"  : http_proxy, \n              \"https\" : https_proxy, \n            }\n\nurl = \"https://api.ipify.org\"\n\nr = requests.get(url, proxies=proxies)\n\nprint(r.text)\n```\n\n## Command Line Usage\n\nAfter installing, you can run the Tor proxy service directly from the command line:\n\n```bash\ntor-proxy\n```\n\nThis will start the Tor SOCKS proxy and print the port it is running on.\n\n```sh\n$ tor-proxy\nconnecting_to_tor: 100% - Done\nTor SOCKS proxy running on port: 47863\n```\n\n### Additional Command Line Options\n\n- Run as a background (detached) process:\n\n  ```bash\n  tor-proxy --detach\n  ```\n  This will start the Tor proxy in the background.\n\n- Kill all running Tor processes started with `/usr/bin/tor -f /tmp/...`:\n\n  ```bash\n  tor-proxy --kill\n  ```\n  This will find and terminate all matching Tor processes.\n\nNow you can use this port as proxy in code.\n\n```python\n# tor_proxy_example.py\nimport requests\n\nport = 47863\n\nhttp_proxy  = f\"socks5h://127.0.0.1:{port}\"\nhttps_proxy = f\"socks5h://127.0.0.1:{port}\"\n\nproxies = { \n              \"http\"  : http_proxy, \n              \"https\" : https_proxy, \n            }\n\nurl = \"https://api.ipify.org\"\n\nr = requests.get(url, proxies=proxies)\n\nprint(r.text)\n```\n\n### Credit :- [onionshare](https://github.com/onionshare/onionshare)\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "A simple way to send your requests with tor using tor-proxy.",
    "version": "0.0.4",
    "project_urls": {
        "Bug Tracker": "https://github.com/jakbin/tor-proxy/issues",
        "Homepage": "https://github.com/jakbin/tor-proxy"
    },
    "split_keywords": [
        "flask",
        " tor",
        " onion",
        " stem",
        " proxy",
        " tor-proxy"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "709a97b66f916620c5c28eab2e534d04d6f5368866bda140d2457022c1175565",
                "md5": "0cffdee013bc990befae33378929d69a",
                "sha256": "a86fc95443b6bd75bec1c63e7187ce3a7e61235bdf42c171247bcf9a90a5da37"
            },
            "downloads": -1,
            "filename": "tor_proxy-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0cffdee013bc990befae33378929d69a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3",
            "size": 13563,
            "upload_time": "2025-07-09T17:15:09",
            "upload_time_iso_8601": "2025-07-09T17:15:09.101238Z",
            "url": "https://files.pythonhosted.org/packages/70/9a/97b66f916620c5c28eab2e534d04d6f5368866bda140d2457022c1175565/tor_proxy-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "9102d6ae85501ba0b87f6079055d1b47278ed809243f78b3a3243a2497d8fee0",
                "md5": "e98ad928b9d53608c0d5b7b9e6db071c",
                "sha256": "edf3a1eb4a27e0389d22025c1d3d309834c24ecfe4ca196ec0efe3ce314f69ac"
            },
            "downloads": -1,
            "filename": "tor_proxy-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "e98ad928b9d53608c0d5b7b9e6db071c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3",
            "size": 12342,
            "upload_time": "2025-07-09T17:15:10",
            "upload_time_iso_8601": "2025-07-09T17:15:10.181791Z",
            "url": "https://files.pythonhosted.org/packages/91/02/d6ae85501ba0b87f6079055d1b47278ed809243f78b3a3243a2497d8fee0/tor_proxy-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-09 17:15:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jakbin",
    "github_project": "tor-proxy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "stem",
            "specs": []
        }
    ],
    "lcname": "tor-proxy"
}
        
Elapsed time: 0.58258s