Giter Club home page Giter Club logo

torpool's Introduction

Docker Pulls Size

torpool

Containerized pool of multiple Tor instances with load balancing and HTTP proxy.

Key features

  • Multiple Tor instances with a single endpoint for the end user
  • Easy configured (IP rotation, country selection of the exit node, etc)
  • Lightweight alpine based Docker image
  • HTTP proxy with Privoxy
  • HTTP/Socks load balancing with HAProxy
  • Does not using root user inside Docker
              +-----------------------------------------------+           
              | Docker                                        |           
              |                                               |           
              |                   +-------+            +----+ |           
              |                   |Privoxy|------------|Tor1| |           
              |                   +-------+        |   +----+ |           
+------+      | +-------+         +-------+        |   +----+ |           
|Client|--------|Haproxy|-------- |Privoxy|--------|---|Tor2| |           
+------+      | +-------+         +-------+        |   +----+ |           
              |     |             +-------+        |   +----+ |           
              |     |             |Privoxy|--------|---|Tor3| |           
              |     |             +-------+        |   +----+ |           
              |     |                              |          |           
              |     |                              |          |           
              |     +------------------------------+          |           
              |                                               |           
              +-----------------------------------------------+           

Usage

Start 5 Tor instances:

docker run -d -p 9200:9200 -p 9300:9300 u1234x1234/torpool:1.0.2 --Tors=5

HTTP proxy is accessible at port 9300:

curl --proxy localhost:9300 http://ipinfo.io/ip

Socks is accessible at port 9200:

curl --socks5 localhost:9200 http://ipinfo.io/ip

To make Tor instances rotate:

docker run -d -p 9200:9200 -p 9300:9300 u1234x1234/torpool:1.0.2 --MaxCircuitDirtiness 30 --NewCircuitPeriod 30

Use only US exit nodes:

docker run -d -p 9200:9200 -p 9300:9300 u1234x1234/torpool:1.0.2 --ExitNodes {us}

List of available Tor options

To view HAProxy stats page:

docker run -d -p 9200:9200 -p 9300:9300 -p 9500:9500 u1234x1234/torpool:1.0.2

Then open in browser http://localhost:9500/haproxy_stats and enter HAProxy username and password. The default username is haproxy, password is password, but it can be changed using using the volume mounting:

echo "pss" > pass_file
docker run -d -p 9200:9200 -p 9300:9300 -p 9500:9500 -v "$PWD/pass_file":/run/secrets/haproxy_password u1234x1234/torpool:1.0.2

Expected password location: /run/secrets/haproxy_password, username: /run/secrets/haproxy_username.

Docker-compose example:

version: '3'
services:
  torpool:
    image: u1234x1234/torpool:1.0.2
    command: ['--Tors', '2', '--NewCircuitPeriod', '30', '--MaxCircuitDirtiness', '30']
    container_name: torpool
    ports:
      - "9200:9200"
      - "9300:9300"
      - "9500:9500"

Why

There is a lot of great projects on github, but non of them provides all the options listed above. Some of them:

torpool's People

Contributors

u1234x1234 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.