Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LABEL version="latest"
RUN echo '@edge https://dl-cdn.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories && \
echo '@edge https://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories && \
apk -U upgrade && \
apk -v add tor@edge obfs4proxy@edge curl && \
apk -v add tor@edge lyrebird@edge curl && \
chmod 700 /var/lib/tor && \
rm -rf /var/cache/apk/* && \
tor --version
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,20 @@ curl --socks5-hostname 127.0.0.1:9150 https://ipinfo.tw/ip
docker stop tor-socks-proxy
```

### Using bridges
Copy link
Owner

@PeterDaveHello PeterDaveHello Apr 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just asking, is this obfs4proxy replacement related?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not directly. But bridges work via obfs4proxy/lyrebird. Hence the ClientTransportPlugin config below

I suppose if someone's using bridges, they already know about this. Just thought it would be nice to have


Edit `/etc/tor/torrc` and add the following:

Comment on lines +70 to +71
Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation instructs users to 'Edit /etc/tor/torrc', but this file is inside the Docker container, not on the host system. Consider clarifying how to edit this file (e.g., by mounting a custom torrc file, using docker exec, or creating a derived Dockerfile). Users unfamiliar with Docker may not understand how to access this file.

Suggested change
Edit `/etc/tor/torrc` and add the following:
To use bridges, you need to modify the Tor configuration file (`/etc/tor/torrc`) inside the Docker container. There are several ways to do this:
**Option 1: Mount a custom `torrc` file from your host**
1. Create a custom `torrc` file on your host (e.g., `./my-torrc`) and add the following lines:
```
Bridge obfs4 ...
Bridge obfs4 ...
Bridge obfs4 ...
Bridge obfs4 ...
ClientTransportPlugin obfs4 exec /usr/bin/lyrebird
UseBridges 1
```
2. Start the container with your custom config mounted:
```sh
docker run -d --restart=always --name tor-socks-proxy -p 127.0.0.1:9150:9150/tcp -v $(pwd)/my-torrc:/etc/tor/torrc peterdavehello/tor-socks-proxy:latest
```
**Option 2: Edit the file inside a running container**
1. Start the container as usual.
2. Use `docker exec` to open a shell and edit the file:
```sh
docker exec -it tor-socks-proxy vi /etc/tor/torrc
```
(You can use `nano` or `vi` depending on what's available in the container.)
**Option 3: Build a custom image with your own `torrc`**
1. Create a `Dockerfile`:
```Dockerfile
FROM peterdavehello/tor-socks-proxy:latest
COPY my-torrc /etc/tor/torrc
```
2. Build and run your custom image.
---
Add the following lines to your `torrc` (as shown above):

Copilot uses AI. Check for mistakes.
```
Bridge obfs4 ...
Bridge obfs4 ...
Bridge obfs4 ...
Bridge obfs4 ...

ClientTransportPlugin obfs4 exec /usr/bin/lyrebird
UseBridges 1
```

## IP Renewal

By default, Tor automatically changes IPs every 10 minutes. You can manually renew the IP by restarting the container:
Expand Down