Sign inSign up

ucezz/tor-proxy

By ucezz

•Updated 10 days ago

SOCKS proxy backed by tor in client-only mode with OBFS4 bridges support and bridge auto management

Image
Networking
0

809

ucezz/tor-proxy repository overview

⁠tor-proxy

tor + obfs4 wrapper image providing pretty stable SOCKS5 & HTTPS local proxy for any purpose

⁠setup

⁠environment variables:
  • CRONTAB: classic crontab file content, used for connection health check and bridges management
  • INIT_BRIDGES: initial bridges list, optional, it's content would be appended to torrc
  • TZ: set your time zone to match container's logs time to your local time
⁠ports:
  • 9050: SOCKS5 proxy
  • 9051: tor control port
  • 9080: tor HTTPS proxy
⁠volumes:
  • /etc/tor/torrc.d: all *.conf files from this mount would be included into torrc
  • /var/log/tor: logs directory, used for pruning dead bridges

⁠example compose file

services:
  tor:
    container_name: "tor-proxy"
    image: ucezz/tor-proxy:trixie
    restart: unless-stopped
    environment:
      CRONTAB: |
        * * * * * root tor-watchdog
        30 * * * * root tor-get-bridges
        35 * * * * root tor-prune-bridges
      INIT_BRIDGES: |
        Bridge obfs4 51.81.26.157:443 8A7322A463C051DB6DC35B1159F119FC3373BB06 cert=kp6Czj/f+McG9OKwltQ4kGb41mjj8Mzp3flpTG8/VK5zXtfnZ+DToe33fumyq7Yq7WnbGA iat-mode=0
        Bridge obfs4 87.167.226.57:45439 469CC6FA33961F5322C5D00007B42EF3D5B398CC cert=1r/SSKByXjRsy140delLG8r8n7m3GFGjsdGFajSSwAd6MeObBXWIVjRqOAmaUUNENMayLA iat-mode=0
      TZ: UTC
    ports:
      - 0.0.0.0:9050:9050
    volumes:
      - ./torrc.d:/etc/tor/torrc.d:rw
      - ./log:/var/log/tor:rw

⁠embedded scripts

Pure shell script using grep⁠, sed⁠, links⁠ and curl⁠ as additional utilities

  • tor-add-bridge - used to add new bridge and restart container
  • tor-get-bridges - used to acquire new bridges from official Tor source
  • tor-prune-bridges - used to prune dead bridges reported by tor in log file. reported bridges get commented with # and still persist in torrc.d/bridges.conf
  • tor-recover-bridges - used to uncomment all previously commented bridges in case of no active bridges are present
  • tor-watchdog - used to check if connection is alive by calling official Tor check webpage and restart container in case of connection is dead

Tag summary

Content type

Image

Digest

sha256:26a7bfa52…

Size

36.5 MB

Last updated

10 days ago

docker pull ucezz/tor-proxy:bullseye