{"id":16274594,"url":"https://github.com/datawookie/docker-tor-privoxy","last_synced_at":"2025-06-25T13:34:00.839Z","repository":{"id":89368984,"uuid":"253428784","full_name":"datawookie/docker-tor-privoxy","owner":"datawookie","description":null,"archived":false,"fork":false,"pushed_at":"2020-09-18T10:47:20.000Z","size":38,"stargazers_count":6,"open_issues_count":1,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T09:36:04.581Z","etag":null,"topics":["docker","privoxy","proxy","tor"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datawookie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-06T07:42:32.000Z","updated_at":"2024-07-02T19:15:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"a7ef5212-cbb2-4151-95da-f96ad6d8367e","html_url":"https://github.com/datawookie/docker-tor-privoxy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/datawookie/docker-tor-privoxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datawookie%2Fdocker-tor-privoxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datawookie%2Fdocker-tor-privoxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datawookie%2Fdocker-tor-privoxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datawookie%2Fdocker-tor-privoxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datawookie","download_url":"https://codeload.github.com/datawookie/docker-tor-privoxy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datawookie%2Fdocker-tor-privoxy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261883251,"owners_count":23224464,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","privoxy","proxy","tor"],"created_at":"2024-10-10T18:29:20.849Z","updated_at":"2025-06-25T13:34:00.826Z","avatar_url":"https://github.com/datawookie.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](tor-project-logo.svg)\n\nAn image based on Alpine Linux with [Tor](https://www.torproject.org/), [Privoxy](https://www.privoxy.org/) and [Squid](http://www.squid-cache.org/).\n\n# Background\n\nTor provides a SOCKS proxy. We use Privoxy to add an HTTP proxy.\n\n# Docker Image\n\nThese ports are exposed by the image:\n\n- `8888` ⁠— Tor HTTP proxy\n- `9050` ⁠— Tor [SOCKS5](https://en.wikipedia.org/wiki/SOCKS) proxy and\n- `9051` ⁠— Tor control.\n\n### Build\n\nA pre-built image is available [here](https://hub.docker.com/repository/docker/datawookie/tor-privoxy). Pull it using:\n\n```bash\n$ docker pull datawookie/tor-privoxy\n```\n\nYou can also build your own using this repository:\n\n```bash\n$ docker build -t tor-privoxy .\n```\n\nOr use the `Makefile` as follow:\n\n```bash\n$ make build\n```\n\n### Run\n\nTo launch the pre-built image:\n\n```bash\ndocker run --rm --name tor -p 8888:8888 -p 9050:9050 datawookie/tor-privoxy\n```\n\nYou can also launch the image built from this repository:\n\n```bash\ndocker run -p 8888:8888 -p 9050:9050 tor-privoxy\n```\n\nOr use the `Makefile` as follow:\n\n```bash\n$ make run\n```\n\n### Environment Variables\n\nThe following environment variables will modify the behaviour of the container:\n\n- `IP_CHANGE_SECONDS` - Number of seconds between changes of Tor exit address.\n- `EXIT_NODE`\n- `LOG_NOTICE_TARGET` - Where should logging go?\n\nFor example:\n\n```bash\ndocker run -e IP_CHANGE_SECONDS=180 tor-privoxy\n```\n\n### Check\n\nTo check that you are on Tor:\n\n- configure your browser to use 127.0.0.1:8888 as proxy then\n- browse to https://check.torproject.org/.\n\n## Using Tor\n\n### Shell\n\n```bash\n# Direct access to internet.\n$ curl http://httpbin.org/ip\n{\n  \"origin\": \"105.224.106.150\"\n}\n# Access internet through Tor (HTTP proxy).\n$ curl --proxy 127.0.0.1:8888 http://httpbin.org/ip\n{\n  \"origin\": \"185.220.102.4\"\n}\n# Access internet through Tor (SOCKS proxy).\n$ curl --proxy socks5://127.0.0.1:9050 http://httpbin.org/ip\n{\n  \"origin\": \"185.100.87.206\"\n}\n```\n\nYou get a different IP address when you send the request via the proxy. If you wait a while and then send the request again, you'll find that the IP address has changed.\n\n### Python\n\nThe [stem](https://stem.torproject.org/) package exposes functionality for interacting with the Tor controller interface.\n\n```bash\npip3 install stem\n```\n\nUse the requests package to send requests via the Tor proxies.\n\n```python\n\u003e\u003e\u003e import requests\n\u003e\u003e\u003e requests.get(\"http://httpbin.org/ip\").json()\n{'origin': '105.224.106.150'}\n\u003e\u003e\u003e requests.get(\"http://httpbin.org/ip\", proxies={\"http\": \"http://127.0.0.1:8888\"}).json()\n{'origin': '185.220.102.4'}\n\u003e\u003e\u003e requests.get(\"http://httpbin.org/ip\", proxies={\"http\": \"socks5://127.0.0.1:9050\"}).json()\n{'origin': '185.100.87.206'}\n```\n\nThis assumes that you've installed the `requests` module with support for SOCKS5.\n\n```bash\npip3 install -U requests[socks]\n```\n\n### R\n\n```r\n\u003e library(httr)\n\u003e GET(\"http://httpbin.org/ip\")\n{\n  \"origin\": \"105.224.106.150\"\n}\n\u003e GET(\"http://httpbin.org/ip\", use_proxy(\"http://127.0.0.1:8888\"))\n{\n  \"origin\": \"185.220.102.4\"\n}\n\u003e GET(\"http://httpbin.org/ip\", use_proxy(\"socks5://127.0.0.1:9050\"))\n{\n  \"origin\": \"185.100.87.206\"\n}\n```\n\n## Setting Exit Nodes\n\nIt's possible to restrict the exit nodes via the configuration in `torrc`.\n\n```\n# Specify exit node by IP address.\nExitNodes 176.10.99.202\n# Specify exit node by fingerprint.\nExitNodes 19B6F025B4580795FBD9F3ED3C6574CDAF979A2F\n# Specify exit node by country code.\nExitNodes {us} StrictNodes 1\nExitNodes {ua},{ug},{ie} StrictNodes 1\n```\n\nYou can also exclude specific nodes.\n\n```\nExcludeExitNodes {ua} \n```\n\nNote that `ExcludeExitNodes` takes precedence over `ExitNodes`.\n\nThere are three ways to specify exit nodes:\n\n- using [country codes](https://b3rn3d.herokuapp.com/blog/2014/03/05/tor-country-codes)\n- IP addresses or\n- hashes.\n\nIf you want to specify multiple options, use a comma-separated list.\n\nCountry codes need to be enclosed in braces, for example, `{us}`.\n\n## Similar Projects\n\n- https://github.com/mattes/rotating-proxy (Provides access to multiple simultaneous Tor proxies)\n- https://github.com/wallneradam/docker-tor-proxy\n- https://hub.docker.com/r/dperson/torproxy and https://github.com/dperson/torproxy","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatawookie%2Fdocker-tor-privoxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatawookie%2Fdocker-tor-privoxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatawookie%2Fdocker-tor-privoxy/lists"}