1 changed files with 14 additions and 7 deletions
@ -36,8 +36,13 @@ sudo ip route add 0.0.0.0/1 dev tun0 |
|||||
Note that if you paste these commands into a shell script, which you then run with `sudo`, you might want to replace |
Note that if you paste these commands into a shell script, which you then run with `sudo`, you might want to replace |
||||
`$USER` with `$SUDO_USER`. |
`$USER` with `$SUDO_USER`. |
||||
|
|
||||
For DNS to work, you might need an additional tool like [dnsproxy](https://github.com/AdguardTeam/dnsproxy) that is |
This tool implements a virtual DNS feature that is used by default. When a DNS packet to port 53 is detected, an IP |
||||
configured to listen on a local UDP port and communicates with the upstream DNS server via TCP. |
address from `198.18.0.0/15` is chosen and mapped to the query name. Connections destined for an IP address from that |
||||
|
range will supply the proxy with the mapped query name instead of the IP address. Since many proxies do not support UDP, |
||||
|
this enables an out-of-the-box experience in most cases, without relying on third-party resolvers or applications. |
||||
|
Depending on your use case, you may want to disable this feature using `--dns none`. |
||||
|
In that case, you might need an additional tool like [dnsproxy](https://github.com/AdguardTeam/dnsproxy) that is |
||||
|
configured to listen on a local UDP port and communicates with a third-party upstream DNS server via TCP. |
||||
|
|
||||
When you terminate this program and want to eliminate the impact caused by the above several commands, |
When you terminate this program and want to eliminate the impact caused by the above several commands, |
||||
you can execute the following command. The routes will be automatically deleted with the tunnel device. |
you can execute the following command. The routes will be automatically deleted with the tunnel device. |
||||
@ -52,15 +57,17 @@ Tunnel interface to proxy. |
|||||
Usage: tun2proxy [OPTIONS] --proxy <URL> |
Usage: tun2proxy [OPTIONS] --proxy <URL> |
||||
|
|
||||
Options: |
Options: |
||||
-t, --tun <name> Name of the tun interface [default: tun0] |
-t, --tun <name> Name of the tun interface [default: tun0] |
||||
-p, --proxy <URL> The proxy URL in the form proto://[username[:password]@]host:port |
-p, --proxy <URL> Proxy URL in the form proto://[username[:password]@]host:port |
||||
-h, --help Print help |
-d, --dns <method> DNS handling [default: virtual] [possible values: virtual, none] |
||||
-V, --version Print version |
-h, --help Print help |
||||
|
-V, --version Print version |
||||
``` |
``` |
||||
Currently, tun2proxy supports two proxy protocols: HTTP and SOCKS5. A proxy is supplied to the `--proxy` argument in the |
Currently, tun2proxy supports two proxy protocols: HTTP and SOCKS5. A proxy is supplied to the `--proxy` argument in the |
||||
URL format. For example, an HTTP proxy at `1.2.3.4:3128` with a username of `john.doe` and a password of `secret` is |
URL format. For example, an HTTP proxy at `1.2.3.4:3128` with a username of `john.doe` and a password of `secret` is |
||||
supplied as `--proxy http://john.doe:[email protected]:3128`. This works analogously to curl's `--proxy` argument. |
supplied as `--proxy http://john.doe:[email protected]:3128`. This works analogously to curl's `--proxy` argument. |
||||
|
|
||||
## TODO |
## TODO |
||||
|
- Increase error robustness (reduce `unwrap` and `expect` usage) |
||||
- UDP support for SOCKS |
- UDP support for SOCKS |
||||
- Virtual DNS |
- Native support for proxying DNS over TCP or TLS |
||||
|
|||||
Loading…
Reference in new issue