This project provides a Docker container running a Tor client with an authenticated SOCKS5 proxy powered by 3proxy.
docker build -t tor-client .You can run the container and set your desired username and password for the proxy.
Security Notice: For security reasons, you should always set your own USERNAME and PASSWORD when running the container. The container will use default credentials (user:password) if these are not provided, which is insecure for any real use case.
docker run --rm -p 1080:1080 \
-e USERNAME=myuser \
-e PASSWORD=mypassword \
tor-clientIf you don't provide USERNAME and PASSWORD environment variables, the container will fall back to default credentials and print a warning.
When the container starts, wait for the Tor process to bootstrap. You will see log messages, and you should wait for Bootstrapped 100% (done): Done before attempting to use the proxy.
You can provide your own torrc configuration file mounting to /etc/tor/torrc:
```bash
docker run --rm -p 1080:1080 \
-v $(pwd)/my-custom-torrc:/etc/tor/torrc \
tor-client
```
If neither is provided, the container generates a default configuration with reasonable defaults (SocksPort 9050, logging to stdout, etc.).
Configure your application to use a SOCKS5 proxy at 127.0.0.1:1080 with the username and password you set.
You can test the proxy with curl:
curl --socks5 127.0.0.1:1080 --proxy-user "myuser:mypassword" https://check.torproject.org/api/ipThe output should show that you are connected through Tor:
{"IsTor":true,"IP":"...","Country":"..."}