This repository provides a Docker setup to run Tor and Privoxy in containers
402
This repository provides a Docker setup to run Tor and Privoxy in containers, enabling anonymous and secure browsing on the internet. Tor is a network of virtual tunnels that enhances privacy and security online. Privoxy is a filtering proxy that improves privacy, modifies web data, and removes ads and other unwanted content.
You can dynamically adjust the Tor and Privoxy configuration by using environment variables. Each environment variable corresponds to a specific configuration option in the Tor or Privoxy configuration files. The format is as follows:
Tor Configuration: Environment variables should be prefixed with TOR_ followed by the option name. For example:
ControlPort option, use TOR_ControlPort=9051.SOCKSPort option, use TOR_SOCKSPort=0.0.0.0:9050.Privoxy Configuration: Similarly, environment variables for Privoxy should be prefixed with PRIVOXY_. For example:
listen-address option, use PRIVOXY_listen_address=0.0.0.0:8118.toggle option, use PRIVOXY_toggle=1.Clone this repository:
git clone https://github.com/jansouza/tor-privoxy.git
cd tor-privoxy
Build the Docker image:
docker build -t tor-privoxy .
Run the container:
docker run -d \
--name tor-privoxy \
-p 9050:9050 \
-p 9051:9051 \
-p 8118:8118 \
-e TOR_SOCKSPort=0.0.0.0:9050 \
-e TOR_ControlPort=9051 \
-e PRIVOXY_listen-address=0.0.0.0:8118 \
tor-privoxy
This will start Tor on port 9050 and Privoxy on port 8118.
You can use Docker Compose to manage the container more easily. Here’s an example docker-compose.yml file:
version: '3'
services:
tor-privoxy:
build: .
ports:
- "9050:9050"
- "9051:9051"
- "8118:8118"
environment:
- TOR_SOCKSPort=0.0.0.0:9050
- TOR_ControlPort=9051
- PRIVOXY_listen-address=0.0.0.0:8118
To start the service using Docker Compose, run:
docker-compose up -d
# SOCKS5 Proxy
curl -x socks5h://localhost:9050 -s https://check.torproject.org/api/ip
# HTTP Proxy
curl -x http://localhost:8118 -s https://check.torproject.org/api/ip
After starting the container, you can configure your browser or other applications to use the HTTP proxy at localhost:8118 (Privoxy) or the SOCKS5 proxy at localhost:9050 (Tor).
Feel free to open issues or submit pull requests for improvements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for more details.
Content type
Image
Digest
sha256:0bd340462…
Size
29.9 MB
Last updated
about 2 years ago
docker pull jansouza/tor-privoxy