Skip to content

Commit

Permalink
Add docs/example for SOCKS proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
aramperes committed Dec 24, 2023
1 parent c3b7526 commit 21fe78f
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,49 @@ if the least recently used port hasn't been used for a certain amount of time. I

All in all, I would not recommend using UDP forwarding for public services, since it's most likely prone to simple DoS or DDoS.

## HTTP/SOCKS Proxy

**onetun** is a Transport-layer proxy (also known as port forwarding); it is not in scope to provide
a HTTP/SOCKS proxy server. However, you can easily chain **onetun** with a proxy server on a remote
that is locked down to your WireGuard network.

For example, you could run [dante-server](https://www.inet.no/dante/) on a peer (ex. `192.168.4.2`) with the following configuration:

```
# /etc/danted.conf
logoutput: syslog
user.privileged: root
user.unprivileged: nobody
internal: 192.168.4.2 port=1080
external: eth0
socksmethod: none
clientmethod: none
# Locks down proxy use to WireGuard peers (192.168.4.x)
client pass {
from: 192.168.4.0/24 to: 0.0.0.0/0
}
socks pass {
from: 192.168.4.0/24 to: 0.0.0.0/0
}
```

Then use **onetun** to expose the SOCKS5 proxy locally:

```shell
onetun 127.0.0.1:1080:192.168.4.2:1080
INFO onetun::tunnel > Tunneling TCP [127.0.0.1:1080]->[192.168.4.2:1080] (via [140.30.3.182:51820] as peer 192.168.4.3)
```

Test with `curl` (or configure your browser):

```shell
curl -x socks5://127.0.0.1:1080 https://ifconfig.me
```

## Contributing and Maintenance

I will gladly accept contributions to onetun, and set aside time to review all pull-requests.
Expand Down

0 comments on commit 21fe78f

Please sign in to comment.