Coder Social home page Coder Social logo

liransehayk2 / tor-socks-proxy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from peterdavehello/tor-socks-proxy

0.0 0.0 0.0 48 KB

๐ŸŒ Tor SOCKS5 proxy server in ๐Ÿณ Docker. Size < 10MB

Home Page: https://hub.docker.com/r/peterdavehello/tor-socks-proxy/

Dockerfile 41.67% Shell 58.33%

tor-socks-proxy's Introduction

Tor-socks-proxy

license Build Status Docker Hub pulls Docker image layers Docker image version

Docker Hub badge

The super easy way to setup a Tor SOCKS5 proxy server inside a Docker container without relay/exit feature.

Usage

  1. Setup the proxy server at the first time

    $ docker run -d --restart=always --name tor-socks-proxy -p 127.0.0.1:9150:9150 peterdavehello/tor-socks-proxy:latest
    • With parameter --restart=always the container will always start on daemon startup, which means it'll automatically start after system reboot.
    • Use 127.0.0.1 to limit the connections from localhost, do not change it unless you know you're going to expose it to a local network or to the Internet.
    • Change to first 9150 to any valid and free port you want, please note that port 9050/9150 may already taken if you are also running other Tor client, like TorBrowser.
    • Do not touch the second 9150 as it's the port inside the docker container unless you're going to change the port in Dockerfile.

    If you already setup the instance before (not the first time) but it's in stopped state, you can just start it instead of creating a new one:

    $ docker start tor-socks-proxy
  2. Make sure it's running, it'll take a short time to bootstrap

    $ docker logs tor-socks-proxy
    .
    .
    .
    Jan 10 01:06:59.000 [notice] Bootstrapped 85%: Finishing handshake with first hop
    Jan 10 01:07:00.000 [notice] Bootstrapped 90%: Establishing a Tor circuit
    Jan 10 01:07:02.000 [notice] Tor has successfully opened a circuit. Looks like client functionality is working.
    Jan 10 01:07:02.000 [notice] Bootstrapped 100%: Done
  3. Configure your client to use it, target on 127.0.0.1 port 9150(Or the other port you setup in step 1)

    Take curl as an example, checkout what's your IP address via Tor network:

    $ curl --socks5-hostname 127.0.0.1:9150 https://ipinfo.tw/ip
    $ curl --socks5-hostname 127.0.0.1:9150 https://ipinfo.io/ip
    $ curl --socks5-hostname 127.0.0.1:9150 https://icanhazip.com
    $ curl --socks5-hostname 127.0.0.1:9150 https://ipecho.net/plain

    Take ssh and nc as an example, connect to a host via Tor:

    $ ssh -o ProxyCommand='nc -x 127.0.0.1:9150 %h %p' target.hostname.blah
  4. After using it, you can turn it off

    $ docker stop tor-socks-proxy

IP renewal

  • Tor changes circuit automatically every 10 minutes by default, which usually bring you the new IP address, it's affected by MaxCircuitDirtiness config, you can override it with your own torrc. See the official manual for more details.

  • To manually renew the IP that Tor gives you, simply restart your docker container to open a new circuit:

    $ docker restart tor-socks-proxy

    Just note that all the connections will be terminated and need to be reestablished.

Note

For the Tor project sustainability, I strongly encourage you to help setup Tor bridge/exit nodes(script) and donate money to the Tor project (Not this proxy project) when you have the ability/capacity!

tor-socks-proxy's People

Contributors

liransehayk2 avatar peterdavehello avatar renovate-bot 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.