Sign inSign up

ucezz/tor-proxy

By ucezz

•Updated about 18 hours ago

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

Image
Networking
0

522

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 appended to torrc
  • /var/log/tor: logs directory, used for pruning dead bridges

⁠example compose file

services:
  tor:
    container_name: "tor-proxy"
    image: ucezz/tor-proxy:bookworm
    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 (links is used to parse html response)
  • tor-prune-bridges - used to prune dead bridges reported by tor in log file. pruned bridges get commented with # and still persist in torrc.d/bridges.conf
  • tor-recover-bridges - used to uncomment all previously commented bridges in case if no active brigde is present
  • tor-watchdog - used to check if connection is alive by calling official Tor check webpage (curl is used) and restart container in case of connection is dead

Tag summary

Content type

Image

Digest

sha256:795467ae3…

Size

48.1 MB

Last updated

about 18 hours ago

docker pull ucezz/tor-proxy:trixie