{"id":13587243,"url":"https://github.com/zhaow-de/rotating-tor-http-proxy","last_synced_at":"2026-02-13T15:24:40.861Z","repository":{"id":45845102,"uuid":"332071705","full_name":"zhaow-de/rotating-tor-http-proxy","owner":"zhaow-de","description":"A multi-arch image provides one HTTP proxy endpoint with many concurrent tunnels to the Tor network.","archived":false,"fork":false,"pushed_at":"2026-02-13T07:49:00.000Z","size":640,"stargazers_count":224,"open_issues_count":7,"forks_count":45,"subscribers_count":9,"default_branch":"main","last_synced_at":"2026-02-13T14:56:24.615Z","etag":null,"topics":["amd64","arm64","armv6","armv7","crawler","docker-image","dockerhub-image","haproxy","multi-platform","privoxy-tor","proxy","tor"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/zhaowde/rotating-tor-http-proxy","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhaow-de.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-01-22T21:58:27.000Z","updated_at":"2026-02-13T07:49:01.000Z","dependencies_parsed_at":"2024-01-27T08:28:53.587Z","dependency_job_id":"c7a14664-bd76-4300-9cd3-d7b6cf706298","html_url":"https://github.com/zhaow-de/rotating-tor-http-proxy","commit_stats":null,"previous_names":[],"tags_count":146,"template":false,"template_full_name":null,"purl":"pkg:github/zhaow-de/rotating-tor-http-proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhaow-de%2Frotating-tor-http-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhaow-de%2Frotating-tor-http-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhaow-de%2Frotating-tor-http-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhaow-de%2Frotating-tor-http-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhaow-de","download_url":"https://codeload.github.com/zhaow-de/rotating-tor-http-proxy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhaow-de%2Frotating-tor-http-proxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29411145,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T06:24:03.484Z","status":"ssl_error","status_checked_at":"2026-02-13T06:23:12.830Z","response_time":78,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["amd64","arm64","armv6","armv7","crawler","docker-image","dockerhub-image","haproxy","multi-platform","privoxy-tor","proxy","tor"],"created_at":"2024-08-01T15:06:07.157Z","updated_at":"2026-02-13T15:24:40.842Z","avatar_url":"https://github.com/zhaow-de.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"![GitHub](https://img.shields.io/github/license/zhaow-de/rotating-tor-http-proxy)\n![Docker Image Version (latest semver)](https://img.shields.io/docker/v/zhaowde/rotating-tor-http-proxy?sort=semver)\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/zhaow-de/rotating-tor-http-proxy/auto-upgrade.yml)\n[![Docker Pulls](https://img.shields.io/docker/pulls/zhaowde/rotating-tor-http-proxy.svg)](https://hub.docker.com/r/zhaowde/rotating-tor-http-proxy/)\n![Docker Image Size (latest semver)](https://img.shields.io/docker/image-size/zhaowde/rotating-tor-http-proxy?sort=semver)\n\n# rotating-tor-http-proxy\n\nThis Docker image provides one HTTP proxy endpoint with many IP addresses for use scenarios like web crawling.\n\n![Screenshot](https://raw.githubusercontent.com/zhaow-de/rotating-tor-http-proxy/main/images/screenshot_1.gif)\n\nBehind the scene, it has a HAProxy sitting in front of multiple pairs of Privoxy-Tor. The HAProxy dispatches the incoming\nrequests to the Privoxy instances with a round-robin strategy. \n\n## Usage\n\nThis image is multi-platform enabled, currently supporting:\n- amd64 (x86_64)\n- arm64 (aarch64)\n- arm/v7 (armhf)\n- arm/v6 (armel)\n\n### Simple case\n```shell\ndocker run --rm -it -p 3128:3128 zhaowde/rotating-tor-http-proxy\n```\nAt the host, `127.0.0.1:3128` is the HTTP/HTTPS proxy address.\n\n### Moreover\n\n```shell\ndocker run --rm -it -p 3128:3128 -p 4444:4444 -e \"TOR_INSTANCES=5\" -e \"TOR_REBUILD_INTERVAL=3600\" -e \"TOR_EXIT_COUNTRY=de,ch,at\" zhaowde/rotating-tor-http-proxy\n```\n\n#### Port `4444/TCP`\n\nPort `4444/TCP` can be mapped to the host if HAProxy stats information is needed. With `docker run -p 4444:4444`, the HAProxy statistics\nreport is available at http://127.0.0.1:4444.  An [article](https://www.haproxy.com/blog/exploring-the-haproxy-stats-page/) from the\nHAProxy official blog explains in detail how to understand this report.\n\n#### `TOR_INSTANCES`\n\nEnvironment variable `TOR_INSTANCES` can be used to config the number of concurrent Tor clients (as well as the associated Privoxy \ninstances). The default is 10, and the valid value is purposely limited to the range between 1 and 40. \n\n#### `TOR_REBUILD_INTERVAL`\nEach Tor client attempts to build a new circuit (results in a new outbound IP address) every 30 seconds. Every 30 minutes, this image\nrebuilds all the circuits. This interval can be changed with environment variable `TOR_REBUILD_INTERVAL`, the default value is 1800\nseconds, while it can be set up any number greater than 600 seconds.\n\n#### `TOR_EXIT_COUNTRY`\n\nFor some crawling tasks, it requires limiting the IP addresses to a certain country to avoid triggering the unnecessary recaptcha verification. \nEnvironment variable `TOR_EXIT_COUNTRY` can be used to specify a country (or a list of countries).\nPlease note the following remarks:\n * **Note 1**: Modifying the way that Tor creates its circuits is strongly discouraged, overriding the entry/exit nodes can compromise the anonymity.\n * **Note 2**: The tor bridge is configured to strictly respect the exit countries if it is specified.\n   For the countries with too fewer exit nodes (e.g., Switzerland), it would take significantly longer time to build up the circuit.\n * **Note 3**: The environment variable accepts a single country code (e.g., `TOR_EXIT_COUNTRY=de`) or a comma-separated list (e.g., `TOR_EXIT_COUNTRY=de,at,ch`)\n * **Note 4**: The acceptable country codes:\n\n   | Country                               | Code | Country                   | Code | Country                               | Code | Country                     | Code | Country                       | Code        | Country                      | Code |\n   |---------------------------------------|------|---------------------------|------|---------------------------------------|------|-----------------------------|------|-------------------------------|-------------|------------------------------|------|\n   | ASCENSION ISLAND                      | `ac` | AFGHANISTAN               | `af` | ALAND                                 | `ax` | ALBANIA                     | `al` | ALGERIA                       | `dz`        | ANDORRA                      | `ad` |\n   | ANGOLA                                | `ao` | ANGUILLA                  | `ai` | ANTARCTICA                            | `aq` | ANTIGUA AND BARBUDA         | `ag` | ARGENTINA REPUBLIC            | `ar`        | ARMENIA                      | `am` |\n   | ARUBA                                 | `aw` | AUSTRALIA                 | `au` | AUSTRIA                               | `at` | AZERBAIJAN                  | `az` | BAHAMAS                       | `bs`        | BAHRAIN                      | `bh` |\n   | BANGLADESH                            | `bd` | BARBADOS                  | `bb` | BELARUS                               | `by` | BELGIUM                     | `be` | BELIZE                        | `bz`        | BENIN                        | `bj` |\n   | BERMUDA                               | `bm` | BHUTAN                    | `bt` | BOLIVIA                               | `bo` | BOSNIA AND HERZEGOVINA      | `ba` | BOTSWANA                      | `bw`        | BOUVET ISLAND                | `bv` |\n   | BRAZIL                                | `br` | BRITISH INDIAN OCEAN TERR | `io` | BRITISH VIRGIN ISLANDS                | `vg` | BRUNEI DARUSSALAM           | `bn` | BULGARIA                      | `bg`        | BURKINA FASO                 | `bf` |\n   | BURUNDI                               | `bi` | CAMBODIA                  | `kh` | CAMEROON                              | `cm` | CANADA                      | `ca` | CAPE VERDE                    | `cv`        | CAYMAN ISLANDS               | `ky` |\n   | CENTRAL AFRICAN REPUBLIC              | `cf` | CHAD                      | `td` | CHILE                                 | `cl` | PEOPLE'S REPUBLIC OF CHINA  | `cn` | CHRISTMAS ISLANDS             | `cx`        | COCOS ISLANDS                | `cc` |\n   | COLOMBIA                              | `co` | COMORAS                   | `km` | CONGO                                 | `cg` | CONGO (DEMOCRATIC REPUBLIC) | `cd` | COOK ISLANDS                  | `ck`        | COSTA RICA                   | `cr` |\n   | COTE D IVOIRE                         | `ci` | CROATIA                   | `hr` | CUBA                                  | `cu` | CYPRUS                      | `cy` | CZECH REPUBLIC                | `cz`        | DENMARK                      | `dk` |\n   | DJIBOUTI                              | `dj` | DOMINICA                  | `dm` | DOMINICAN REPUBLIC                    | `do` | EAST TIMOR                  | `tp` | ECUADOR                       | `ec` \tEGYPT | `eg`                         |\n   | EL SALVADOR                           | `sv` | EQUATORIAL GUINEA         | `gq` | ESTONIA                               | `ee` | ETHIOPIA                    | `et` | FALKLAND ISLANDS              | `fk`        | FAROE ISLANDS                | `fo` |\n   | FIJI                                  | `fj` | FINLAND                   | `fi` | FRANCE                                | `fr` | FRANCE METROPOLITAN         | `fx` | FRENCH GUIANA                 | `gf`        | FRENCH POLYNESIA             | `pf` |\n   | FRENCH SOUTHERN TERRITORIES           | `tf` | GABON                     | `ga` | GAMBIA                                | `gm` | GEORGIA                     | `ge` | GERMANY                       | `de`        | GHANA                        | `gh` |\n   | GIBRALTER                             | `gi` | GREECE                    | `gr` | GREENLAND                             | `gl` | GRENADA                     | `gd` | GUADELOUPE                    | `gp`        | GUAM                         | `gu` |\n   | GUATEMALA                             | `gt` | GUINEA                    | `gn` | GUINEA-BISSAU                         | `gw` | GUYANA                      | `gy` | HAITI                         | `ht`        | HEARD \u0026 MCDONALD ISLAND      | `hm` |\n   | HONDURAS                              | `hn` | HONG KONG                 | `hk` | HUNGARY                               | `hu` | ICELAND                     | `is` | INDIA                         | `in`        | INDONESIA                    | `id` |\n   | IRAN, ISLAMIC REPUBLIC OF             | `ir` | IRAQ                      | `iq` | IRELAND                               | `ie` | ISLE OF MAN                 | `im` | ISRAEL                        | `il`        | ITALY                        | `it` |\n   | JAMAICA                               | `jm` | JAPAN                     | `jp` | JORDAN                                | `jo` | KAZAKHSTAN                  | `kz` | KENYA                         | `ke`        | KIRIBATI                     | `ki` |\n   | KOREA, DEM. PEOPLES REP OF            | `kp` | KOREA, REPUBLIC OF        | `kr` | KUWAIT                                | `kw` | KYRGYZSTAN                  | `kg` | LAO PEOPLE'S DEM. REPUBLIC    | `la`        | LATVIA                       | `lv` |\n   | LEBANON                               | `lb` | LESOTHO                   | `ls` | LIBERIA                               | `lr` | LIBYAN ARAB JAMAHIRIYA      | `ly` | LIECHTENSTEIN                 | `li`        | LITHUANIA                    | `lt` |\n   | LUXEMBOURG                            | `lu` | MACAO                     | `mo` | MACEDONIA                             | `mk` | MADAGASCAR                  | `mg` | MALAWI                        | `mw`        | MALAYSIA                     | `my` |\n   | MALDIVES                              | `mv` | MALI                      | `ml` | MALTA                                 | `mt` | MARSHALL ISLANDS            | `mh` | MARTINIQUE                    | `mq`        | MAURITANIA                   | `mr` |\n   | MAURITIUS                             | `mu` | MAYOTTE                   | `yt` | MEXICO                                | `mx` | MICRONESIA                  | `fm` | MOLDAVA REPUBLIC OF           | `md`        | MONACO                       | `mc` |\n   | MONGOLIA                              | `mn` | MONTENEGRO                | `me` | MONTSERRAT                            | `ms` | MOROCCO                     | `ma` | MOZAMBIQUE                    | `mz`        | MYANMAR                      | `mm` |\n   | NAMIBIA                               | `na` | NAURU                     | `nr` | NEPAL                                 | `np` | NETHERLANDS ANTILLES        | `an` | NETHERLANDS, THE              | `nl`        | NEW CALEDONIA                | `nc` |\n   | NEW ZEALAND                           | `nz` | NICARAGUA                 | `ni` | NIGER                                 | `ne` | NIGERIA                     | `ng` | NIUE                          | `nu`        | NORFOLK ISLAND               | `nf` |\n   | NORTHERN MARIANA ISLANDS              | `mp` | NORWAY                    | `no` | OMAN                                  | `om` | PAKISTAN                    | `pk` | PALAU                         | `pw`        | PALESTINE                    | `ps` |\n   | PANAMA                                | `pa` | PAPUA NEW GUINEA          | `pg` | PARAGUAY                              | `py` | PERU                        | `pe` | PHILIPPINES (REPUBLIC OF THE) | `ph`        | PITCAIRN                     | `pn` |\n   | POLAND                                | `pl` | PORTUGAL                  | `pt` | PUERTO RICO                           | `pr` | QATAR                       | `qa` | REUNION                       | `re`        | ROMANIA                      | `ro` |\n   | RUSSIAN FEDERATION                    | `ru` | RWANDA                    | `rw` | SAMOA                                 | `ws` | SAN MARINO                  | `sm` | SAO TOME/PRINCIPE             | `st`        | SAUDI ARABIA                 | `sa` |\n   | SCOTLAND                              | `uk` | SENEGAL                   | `sn` | SERBIA                                | `rs` | SEYCHELLES                  | `sc` | SIERRA LEONE                  | `sl`        | SINGAPORE                    | `sg` |\n   | SLOVAKIA                              | `sk` | SLOVENIA                  | `si` | SOLOMON ISLANDS                       | `sb` | SOMALIA                     | `so` | SOMOA,GILBERT,ELLICE ISLANDS  | `as`        | SOUTH AFRICA                 | `za` |\n   | SOUTH GEORGIA, SOUTH SANDWICH ISLANDS | `gs` | SOVIET UNION              | `su` | SPAIN                                 | `es` | SRI LANKA                   | `lk` | ST. HELENA                    | `sh`        | ST. KITTS AND NEVIS          | `kn` |\n   | ST. LUCIA                             | `lc` | ST. PIERRE AND MIQUELON   | `pm` | ST. VINCENT \u0026 THE GRENADINES          | `vc` | SUDAN                       | `sd` | SURINAME                      | `sr`        | SVALBARD AND JAN MAYEN       | `sj` |\n   | SWAZILAND                             | `sz` | SWEDEN                    | `se` | SWITZERLAND                           | `ch` | SYRIAN ARAB REPUBLIC        | `sy` | TAIWAN                        | `tw`        | TAJIKISTAN                   | `tj` |\n   | TANZANIA, UNITED REPUBLIC OF          | `tz` | THAILAND                  | `th` | TOGO                                  | `tg` | TOKELAU                     | `tk` | TONGA                         | `to`        | TRINIDAD AND TOBAGO          | `tt` |\n   | TUNISIA                               | `tn` | TURKEY                    | `tr` | TURKMENISTAN                          | `tm` | TURKS AND CALCOS ISLANDS    | `tc` | TUVALU                        | `tv`        | UGANDA                       | `ug` |\n   | UKRAINE                               | `ua` | UNITED ARAB EMIRATES      | `ae` | UNITED KINGDOM (no new registrations) | `gb` | UNITED KINGDOM              | `uk` | UNITED STATES                 | `us`        | UNITED STATES MINOR OUTL.IS. | `um` |\n   | URUGUAY                               | `uy` | UZBEKISTAN                | `uz` | VANUATU                               | `vu` | VATICAN CITY STATE          | `va` | VENEZUELA                     | `ve`        | VIET NAM                     | `vn` |\n   | VIRGIN ISLANDS (USA)                  | `vi` | WALLIS AND FUTUNA ISLANDS | `wf` | WESTERN SAHARA                        | `eh` | YEMEN                       | `ye` | ZAMBIA                        | `zm`        | ZIMBABWE                     | `zw` |\n\n### Test the proxy\n\n```shell\nwhile :; do curl -sx localhost:3128 ifconfig.io; echo \"\"; sleep 2; done\n```\n\n## Credit\n\nAt GitHub, there are many repos build Docker images to provide HTTP proxy connects to the Tor network.\nThe project is reinventing the wheels based on many of them.\nRemarkably:\n- [y4ns0l0/docker-multi-tor](https://github.com/y4ns0l0/docker-multi-tor) creates a setup with multiple pairs of Privoxy-Tor. Having no\n  HAProxy-like dispatcher, each Privoxy expose itself to the host as a different TCP port.\n- [mattes/rotating-proxy](https://github.com/mattes/rotating-proxy) does exactly the same job as this project. However,\n    1. it utilizes [Polipo](https://www.irif.fr/~jch/software/polipo/) as the HTTP-SOCKS proxy adapter. Polipo ceased to be maintained on\n       6 November 2016\n    2. the base image is Ubuntu 14.04, which it too heavy for this case, and out-of-maintenance as well\n    3. the main control logic is written in Ruby\n\n## Bill-of-Material\n\n\u003c!--- Do not manually modify anything below this line! ---\u003e\n\u003c!--- BOM-starts ---\u003e\n- alpine-3.23.3\n- bash-5.3.3\n- curl-8.17.0\n- haproxy-3.2.12\n- privoxy-4.0.0\n- sed-4.9\n- tor-0.4.8.22\n\u003c!--- BOM-ends. Document ends here too ---\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhaow-de%2Frotating-tor-http-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhaow-de%2Frotating-tor-http-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhaow-de%2Frotating-tor-http-proxy/lists"}