mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-06-10 00:27:46 +00:00
rename target from 'tun2proxy' to 'tun2proxy-bin'
make rust compiler happy
This commit is contained in:
parent
77d651dc70
commit
6c8ae7a33f
10 changed files with 24 additions and 24 deletions
6
.github/workflows/publish-exe.yml
vendored
6
.github/workflows/publish-exe.yml
vendored
|
@ -74,9 +74,9 @@ jobs:
|
||||||
if [[ "${{ matrix.host_os }}" == "windows-latest" ]]; then
|
if [[ "${{ matrix.host_os }}" == "windows-latest" ]]; then
|
||||||
powershell -Command "(Get-Item README.md).LastWriteTime = Get-Date"
|
powershell -Command "(Get-Item README.md).LastWriteTime = Get-Date"
|
||||||
powershell -Command "(Get-Item target/${{ matrix.target }}/release/wintun.dll).LastWriteTime = Get-Date"
|
powershell -Command "(Get-Item target/${{ matrix.target }}/release/wintun.dll).LastWriteTime = Get-Date"
|
||||||
powershell Compress-Archive -Path target/${{ matrix.target }}/release/tun2proxy.exe, README.md, target/tun2proxy-ffi.h, target/${{ matrix.target }}/release/tun2proxy.dll, target/${{ matrix.target }}/release/wintun.dll -DestinationPath mypubdir4/tun2proxy-${{ matrix.target }}.zip
|
powershell Compress-Archive -Path target/${{ matrix.target }}/release/tun2proxy-bin.exe, README.md, target/tun2proxy-ffi.h, target/${{ matrix.target }}/release/tun2proxy.dll, target/${{ matrix.target }}/release/wintun.dll -DestinationPath mypubdir4/tun2proxy-${{ matrix.target }}.zip
|
||||||
elif [[ "${{ matrix.host_os }}" == "macos-latest" ]]; then
|
elif [[ "${{ matrix.host_os }}" == "macos-latest" ]]; then
|
||||||
zip -j mypubdir4/tun2proxy-${{ matrix.target }}.zip target/${{ matrix.target }}/release/tun2proxy README.md target/tun2proxy-ffi.h target/${{ matrix.target }}/release/libtun2proxy.dylib
|
zip -j mypubdir4/tun2proxy-${{ matrix.target }}.zip target/${{ matrix.target }}/release/tun2proxy-bin README.md target/tun2proxy-ffi.h target/${{ matrix.target }}/release/libtun2proxy.dylib
|
||||||
if [[ "${{ matrix.target }}" == "x86_64-apple-darwin" ]]; then
|
if [[ "${{ matrix.target }}" == "x86_64-apple-darwin" ]]; then
|
||||||
./build-aarch64-apple-ios.sh
|
./build-aarch64-apple-ios.sh
|
||||||
zip -r mypubdir4/tun2proxy-aarch64-apple-ios-xcframework.zip ./tun2proxy.xcframework/
|
zip -r mypubdir4/tun2proxy-aarch64-apple-ios-xcframework.zip ./tun2proxy.xcframework/
|
||||||
|
@ -84,7 +84,7 @@ jobs:
|
||||||
zip -r mypubdir4/tun2proxy-apple-xcframework.zip ./tun2proxy.xcframework/
|
zip -r mypubdir4/tun2proxy-apple-xcframework.zip ./tun2proxy.xcframework/
|
||||||
fi
|
fi
|
||||||
elif [[ "${{ matrix.host_os }}" == "ubuntu-latest" ]]; then
|
elif [[ "${{ matrix.host_os }}" == "ubuntu-latest" ]]; then
|
||||||
zip -j mypubdir4/tun2proxy-${{ matrix.target }}.zip target/${{ matrix.target }}/release/tun2proxy README.md target/tun2proxy-ffi.h target/${{ matrix.target }}/release/libtun2proxy.so
|
zip -j mypubdir4/tun2proxy-${{ matrix.target }}.zip target/${{ matrix.target }}/release/tun2proxy-bin README.md target/tun2proxy-ffi.h target/${{ matrix.target }}/release/libtun2proxy.so
|
||||||
if [[ "${{ matrix.target }}" == "x86_64-unknown-linux-gnu" ]]; then
|
if [[ "${{ matrix.target }}" == "x86_64-unknown-linux-gnu" ]]; then
|
||||||
./build-android.sh
|
./build-android.sh
|
||||||
cp ./tun2proxy-android-libs.zip ./mypubdir4/
|
cp ./tun2proxy-android-libs.zip ./mypubdir4/
|
||||||
|
|
|
@ -62,7 +62,7 @@ windows-service = "0.7"
|
||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "tun2proxy"
|
name = "tun2proxy-bin"
|
||||||
path = "src/bin/main.rs"
|
path = "src/bin/main.rs"
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
|
|
|
@ -15,6 +15,6 @@ FROM ubuntu:latest
|
||||||
|
|
||||||
RUN apt update && apt install -y iproute2 && apt clean all
|
RUN apt update && apt install -y iproute2 && apt clean all
|
||||||
|
|
||||||
COPY --from=builder /worker/target/release/tun2proxy /usr/bin/tun2proxy
|
COPY --from=builder /worker/target/release/tun2proxy-bin /usr/bin/tun2proxy-bin
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/bin/tun2proxy", "--setup"]
|
ENTRYPOINT ["/usr/bin/tun2proxy-bin", "--setup"]
|
||||||
|
|
16
README.md
16
README.md
|
@ -5,9 +5,9 @@ A tunnel interface for HTTP and SOCKS proxies on Linux, Android, macOS, iOS and
|
||||||

|

|
||||||
[](https://docs.rs/tun2proxy)
|
[](https://docs.rs/tun2proxy)
|
||||||
[](https://crates.io/crates/tun2proxy)
|
[](https://crates.io/crates/tun2proxy)
|
||||||
[](https://github.com/blechschmidt/tun2proxy/blob/master/LICENSE)
|
[](https://github.com/tun2proxy/tun2proxy/blob/master/LICENSE)
|
||||||
|
|
||||||
> Additional information can be found in the [wiki](https://github.com/blechschmidt/tun2proxy/wiki)
|
> Additional information can be found in the [wiki](https://github.com/tun2proxy/tun2proxy/wiki)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
- HTTP proxy support (unauthenticated, basic and digest auth)
|
- HTTP proxy support (unauthenticated, basic and digest auth)
|
||||||
|
@ -15,7 +15,7 @@ A tunnel interface for HTTP and SOCKS proxies on Linux, Android, macOS, iOS and
|
||||||
- SOCKS4a and SOCKS5h support (through the virtual DNS feature)
|
- SOCKS4a and SOCKS5h support (through the virtual DNS feature)
|
||||||
- Minimal configuration setup for routing all traffic
|
- Minimal configuration setup for routing all traffic
|
||||||
- IPv4 and IPv6 support
|
- IPv4 and IPv6 support
|
||||||
- GFW evasion mechanism for certain use cases (see [issue #35](https://github.com/blechschmidt/tun2proxy/issues/35))
|
- GFW evasion mechanism for certain use cases (see [issue #35](https://github.com/tun2proxy/tun2proxy/issues/35))
|
||||||
- SOCKS5 UDP support
|
- SOCKS5 UDP support
|
||||||
- Native support for proxying DNS over TCP
|
- Native support for proxying DNS over TCP
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ To build an XCFramework for macOS and iOS, run the following:
|
||||||
|
|
||||||
### Install from binary
|
### Install from binary
|
||||||
|
|
||||||
Download the binary from [releases](https://github.com/blechschmidt/tun2proxy/releases) and put it in your `PATH`.
|
Download the binary from [releases](https://github.com/tun2proxy/tun2proxy/releases) and put it in your `PATH`.
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Authenticity Verification</summary>
|
<summary>Authenticity Verification</summary>
|
||||||
|
@ -66,7 +66,7 @@ describing the manual setup, except that a bind mount is used to overlay the `/e
|
||||||
|
|
||||||
You would then run the tool as follows:
|
You would then run the tool as follows:
|
||||||
```bash
|
```bash
|
||||||
sudo ./target/release/tun2proxy --setup --proxy "socks5://1.2.3.4:1080"
|
sudo ./target/release/tun2proxy-bin --setup --proxy "socks5://1.2.3.4:1080"
|
||||||
```
|
```
|
||||||
|
|
||||||
Apart from SOCKS5, SOCKS4 and HTTP are supported.
|
Apart from SOCKS5, SOCKS4 and HTTP are supported.
|
||||||
|
@ -105,7 +105,7 @@ sudo ip route add 8000::/1 dev tun0
|
||||||
# Make sure that DNS queries are routed through the tunnel.
|
# Make sure that DNS queries are routed through the tunnel.
|
||||||
sudo sh -c "echo nameserver 198.18.0.1 > /etc/resolv.conf"
|
sudo sh -c "echo nameserver 198.18.0.1 > /etc/resolv.conf"
|
||||||
|
|
||||||
./target/release/tun2proxy --tun tun0 --proxy "$PROXY_TYPE://$PROXY_IP:$PROXY_PORT"
|
./target/release/tun2proxy-bin --tun tun0 --proxy "$PROXY_TYPE://$PROXY_IP:$PROXY_PORT"
|
||||||
```
|
```
|
||||||
|
|
||||||
This tool implements a virtual DNS feature that is used by switch `--dns virtual`. When a DNS packet to port 53 is detected, an IP
|
This tool implements a virtual DNS feature that is used by switch `--dns virtual`. When a DNS packet to port 53 is detected, an IP
|
||||||
|
@ -126,7 +126,7 @@ sudo ip link del tun0
|
||||||
```
|
```
|
||||||
Tunnel interface to proxy.
|
Tunnel interface to proxy.
|
||||||
|
|
||||||
Usage: tun2proxy [OPTIONS] --proxy <URL> [ADMIN_COMMAND]...
|
Usage: tun2proxy-bin [OPTIONS] --proxy <URL> [ADMIN_COMMAND]...
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
[ADMIN_COMMAND]... Specify a command to run with root-like capabilities in the new namespace when using `--unshare`.
|
[ADMIN_COMMAND]... Specify a command to run with root-like capabilities in the new namespace when using `--unshare`.
|
||||||
|
@ -173,7 +173,7 @@ docker run -d \
|
||||||
--sysctl net.ipv6.conf.default.disable_ipv6=0 \
|
--sysctl net.ipv6.conf.default.disable_ipv6=0 \
|
||||||
--cap-add NET_ADMIN \
|
--cap-add NET_ADMIN \
|
||||||
--name tun2proxy \
|
--name tun2proxy \
|
||||||
tun2proxy --proxy proto://[username[:password]@]host:port
|
tun2proxy-bin --proxy proto://[username[:password]@]host:port
|
||||||
```
|
```
|
||||||
|
|
||||||
You can then provide the running container's network to another worker container by sharing the network namespace (like kubernetes sidecar):
|
You can then provide the running container's network to another worker container by sharing the network namespace (like kubernetes sidecar):
|
||||||
|
|
|
@ -8,7 +8,7 @@ echo $SCRIPT_DIR
|
||||||
|
|
||||||
netns="test"
|
netns="test"
|
||||||
dante="danted"
|
dante="danted"
|
||||||
tun2proxy="${SCRIPT_DIR}/../target/release/tun2proxy"
|
tun2proxy="${SCRIPT_DIR}/../target/release/tun2proxy-bin"
|
||||||
|
|
||||||
ip netns add "$netns"
|
ip netns add "$netns"
|
||||||
|
|
||||||
|
@ -51,4 +51,4 @@ sleep 3
|
||||||
iperf3 -c 10.0.0.4 -P 10
|
iperf3 -c 10.0.0.4 -P 10
|
||||||
|
|
||||||
# Clean up
|
# Clean up
|
||||||
# sudo sh -c "pkill tun2proxy; pkill iperf3; pkill danted; ip link del tun0; ip netns del test"
|
# sudo sh -c "pkill tun2proxy-bin; pkill iperf3; pkill danted; ip link del tun0; ip netns del test"
|
||||||
|
|
|
@ -30,7 +30,7 @@ function core_function() {
|
||||||
else
|
else
|
||||||
trap 'echo "" && echo "tun2proxy exited with code: $?" && restore' EXIT
|
trap 'echo "" && echo "tun2proxy exited with code: $?" && restore' EXIT
|
||||||
local SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
local SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
local APP_BIN_PATH="${SCRIPT_DIR}/../target/release/tun2proxy"
|
local APP_BIN_PATH="${SCRIPT_DIR}/../target/release/tun2proxy-bin"
|
||||||
"${APP_BIN_PATH}" --tun tun0 --proxy "${PROXY_TYPE}://${PROXY_IP}:${PROXY_PORT}" -v trace
|
"${APP_BIN_PATH}" --tun tun0 --proxy "${PROXY_TYPE}://${PROXY_IP}:${PROXY_PORT}" -v trace
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
|
||||||
netns="test"
|
netns="test"
|
||||||
dante="danted"
|
dante="danted"
|
||||||
tun2proxy="${SCRIPT_DIR}/../target/release/tun2proxy"
|
tun2proxy="${SCRIPT_DIR}/../target/release/tun2proxy-bin"
|
||||||
|
|
||||||
ip netns add "$netns"
|
ip netns add "$netns"
|
||||||
|
|
||||||
|
@ -80,4 +80,4 @@ sleep 3
|
||||||
rperf -c 10.0.0.4 -v trace -P 1 -u -r
|
rperf -c 10.0.0.4 -v trace -P 1 -u -r
|
||||||
|
|
||||||
# Clean up
|
# Clean up
|
||||||
# sudo sh -c "pkill tun2proxy; pkill rperf; pkill danted; ip link del tun0; ip netns del test"
|
# sudo sh -c "pkill tun2proxy-bin; pkill rperf; pkill danted; ip link del tun0; ip netns del test"
|
||||||
|
|
|
@ -100,7 +100,7 @@ async fn namespace_proxy_main(
|
||||||
log::info!("The tun proxy is running in unprivileged mode. See `namespaces(7)`.");
|
log::info!("The tun proxy is running in unprivileged mode. See `namespaces(7)`.");
|
||||||
log::info!("");
|
log::info!("");
|
||||||
log::info!("If you need to run a process that relies on root-like capabilities (e.g. `openvpn`)");
|
log::info!("If you need to run a process that relies on root-like capabilities (e.g. `openvpn`)");
|
||||||
log::info!("Use `tun2proxy --unshare --setup [...] -- openvpn --config [...]`");
|
log::info!("Use `tun2proxy-bin --unshare --setup [...] -- openvpn --config [...]`");
|
||||||
log::info!("");
|
log::info!("");
|
||||||
log::info!("To run a new process in the created namespace (e.g. a flatpak app)");
|
log::info!("To run a new process in the created namespace (e.g. a flatpak app)");
|
||||||
log::info!(
|
log::info!(
|
||||||
|
|
|
@ -8,7 +8,7 @@ echo $SCRIPT_DIR
|
||||||
|
|
||||||
netns="test"
|
netns="test"
|
||||||
dante="danted"
|
dante="danted"
|
||||||
tun2proxy="${SCRIPT_DIR}/../../target/release/tun2proxy"
|
tun2proxy="${SCRIPT_DIR}/../../target/release/tun2proxy-bin"
|
||||||
|
|
||||||
ip netns add "$netns"
|
ip netns add "$netns"
|
||||||
|
|
||||||
|
@ -47,4 +47,4 @@ iperf3 -c 10.0.0.4
|
||||||
iperf3 -c 10.0.0.4 -R -P 10
|
iperf3 -c 10.0.0.4 -R -P 10
|
||||||
|
|
||||||
# Clean up
|
# Clean up
|
||||||
# sudo sh -c "pkill tun2proxy; pkill iperf3; pkill danted; ip link del tun0; ip netns del test"
|
# sudo sh -c "pkill tun2proxy-bin; pkill iperf3; pkill danted; ip link del tun0; ip netns del test"
|
||||||
|
|
|
@ -29,8 +29,8 @@ def get_ip(version=None):
|
||||||
|
|
||||||
|
|
||||||
def get_tool_path():
|
def get_tool_path():
|
||||||
default = glob.glob(os.path.join(os.path.dirname(__file__), '..', 'target', '*', 'tun2proxy'))
|
default = glob.glob(os.path.join(os.path.dirname(__file__), '..', 'target', '*', 'tun2proxy-bin'))
|
||||||
default = default[0] if len(default) > 0 else 'tun2proxy'
|
default = default[0] if len(default) > 0 else 'tun2proxy-bin'
|
||||||
return os.environ.get('TOOL_PATH', default)
|
return os.environ.get('TOOL_PATH', default)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue