Merge branch 'ssrlive' into auth

This commit is contained in:
B. Blechschmidt 2023-03-22 12:03:51 +01:00
commit 5df3877042
3 changed files with 33 additions and 1 deletions

View file

@ -36,7 +36,18 @@ Note that if you paste these commands into a shell script, which you then run wi
For DNS to work, you might need an additional tool like [dnsproxy](https://github.com/AdguardTeam/dnsproxy) that is For DNS to work, 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 the upstream DNS server via TCP. configured to listen on a local UDP port and communicates with the upstream DNS server via TCP.
## CLI (unstable) ## CLI
=======
When you end the running of this program and want to eliminate the impact caused by the above several commands,
you can execute the following commands.
```shell
sudo ip route del 0.0.0.0/1 dev tun0
sudo ip route del 128.0.0.0/1 dev tun0
sudo ip link set tun0 down
sudo ip tuntap del tun0 mode tun
```
## CLI
``` ```
Tunnel interface to proxy. Tunnel interface to proxy.

9
tests/Dockerfile Normal file
View file

@ -0,0 +1,9 @@
FROM alpine:edge
RUN apk add --no-cache cargo rust pkgconfig openssl-dev
RUN mkdir /tun2proxy
ADD src /tun2proxy/src
ADD Cargo.toml /tun2proxy/Cargo.toml
ADD tests /tun2proxy/tests
WORKDIR /tun2proxy
RUN cargo build --tests
ENTRYPOINT ["cargo", "test"]

12
tests/run-tests.sh Executable file
View file

@ -0,0 +1,12 @@
#!/bin/bash
#
# Run as follows:
# sudo SOCKS5_SERVER=<ip>:<port> HTTP_SERVER=<ip>:<port> ./run-tests.sh
#
# Alternatively, `cargo test` can be used instead of `./run-tests.sh`.
# Note that the tests require root privileges and will change
# the system's default routes.
SCRIPT_DIR="$(dirname "$0")"
cd "$SCRIPT_DIR/.."
docker build -t tun2proxy-tests -f tests/Dockerfile . && docker run -e SOCKS5_SERVER -e HTTP_SERVER --rm -it tun2proxy-tests