mstfknn/tor-proxy

By mstfknn

Updated 4 months ago

A lightweight, privacy-focused proxy server using Tor network.

Image
Networking
Security
0

2.2K

mstfknn/tor-proxy repository overview

Tor Proxy Logo

tor-proxy

A lightweight, privacy-focused proxy server using Tor network.

Disclaimer: This project is intended for legitimate and legal use only, such as privacy protection, censorship circumvention, and security research. Users are solely responsible for ensuring their usage complies with applicable laws and regulations.

Quick Start

docker pull mstfknn/tor-proxy
docker run -d -p 9150:9150 -p 8853:5353/udp mstfknn/tor-proxy

Features

  • Routes traffic through the Tor network for anonymity
  • Lightweight and easy to deploy
  • SOCKS5 proxy on port 9150
  • DNS over Tor on port 5353 (mapped to host 8853)
  • Configurable via environment variables
  • Tor Bridge support via -bridge tags (obfs4, meek)
  • Exit node country selection
  • Built-in healthcheck
  • Runs as non-root user
  • Signed container images (cosign)

Environment Variables

VariableDefaultDescription
SOCKS_PORT9150SOCKS5 proxy port
DNS_PORT5353DNS resolution port
ENABLE_LOGfalseEnable Tor logging to stdout
EXIT_NODES-Exit node countries (e.g., {US},{DE})
STRICT_NODES0Only use specified exit nodes (1 to enable)
USE_BRIDGEfalseEnable Tor bridge
BRIDGE_TYPE-Bridge type: obfs4, meek, snowflake
BRIDGE_LINES-Bridge addresses (semicolon-separated)

Usage Examples

Basic
docker run -d -p 9150:9150 mstfknn/tor-proxy:debian
With country selection
docker run -d -p 9150:9150 \
  -e EXIT_NODES="{US},{GB}" \
  -e STRICT_NODES=1 \
  mstfknn/tor-proxy:debian
With bridge (censored networks)

Use the -bridge tagged images which include obfs4proxy:

docker run -d -p 9150:9150 \
  -e USE_BRIDGE=true \
  -e BRIDGE_TYPE=obfs4 \
  -e BRIDGE_LINES="obfs4 1.2.3.4:443 FINGERPRINT cert=... iat-mode=0" \
  mstfknn/tor-proxy:debian-bridge
With persistent data
docker run -d -p 9150:9150 \
  -v tor-data:/var/lib/tor \
  mstfknn/tor-proxy:debian

Multi-Instance Load Balancing

Run multiple Tor instances behind HAProxy for different exit IPs per request:

docker compose -f docker-compose.multi.yml up -d
Client → :9150 → HAProxy → tor-1 (circuit A)
                          → tor-2 (circuit B)
                          → tor-3 (circuit C)

No additional image build is required — it uses the pre-built mstfknn/tor-proxy:debian image and the official haproxy:alpine image. See GitHub repo for docker-compose.multi.yml and haproxy.cfg.

Testing

Configure your application to use the SOCKS5 proxy at localhost:9150 and verify your IP:

curl --socks5-hostname localhost:9150 https://check.torproject.org/api/ip

Available Tags

TagDescription
debian, latestDebian-based, standard
alpineAlpine-based, minimal
debian-bridgeDebian + obfs4proxy (bridge support)
alpine-bridgeAlpine + obfs4proxy (bridge support)

GitHub

https://github.com/mstfknn/tor-proxy

Tag summary

Content type

Image

Digest

sha256:b29fd2f34

Size

498 Bytes

Last updated

4 months ago

docker pull mstfknn/tor-proxy:sha256-4cdd370c3c3463546b0b38599eebc32b5b0eb390fc3413c815c5d7cd6f533ecd.sig