From 63f33aeb86140f770ac80110c0eae3df7225d075 Mon Sep 17 00:00:00 2001 From: zonyitoo Date: Wed, 18 Oct 2023 23:00:38 +0800 Subject: [PATCH] feat(local): local-tun Windows README --- README.md | 9 +++++++++ crates/shadowsocks-service/src/local/tun/tcp.rs | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 856f659e..4f27d2ee 100644 --- a/README.md +++ b/README.md @@ -407,6 +407,7 @@ Redirects connections with `iptables` configurations to the port that `sslocal` - Linux, Android - macOS, iOS +- Windows #### Linux @@ -431,6 +432,14 @@ sslocal --protocol tun -s "[::1]:8388" -m "aes-256-gcm" -k "hello-kitty" --outbo It will create a Tun interface with address `10.255.0.1` and netmask `255.255.255.0`. +#### Windows + +Download `wintun.dll` from [Wintun](https://www.wintun.net/), and place it in the folder with shadowsocks' runnable binaries, or in the system PATH. + +```powershell +sslocal --protocol tun -s "[::1]:8388" -m "aes-256-gcm" -k "hello-kitty" --outbound-bind-interface "Loopback" --tun-interface-name "shadowsocks" +``` + ### Local client for Windows Service Compile it by enabling `--features "winservice"` (not included in the default build): diff --git a/crates/shadowsocks-service/src/local/tun/tcp.rs b/crates/shadowsocks-service/src/local/tun/tcp.rs index cf2a68fe..f0b121dd 100644 --- a/crates/shadowsocks-service/src/local/tun/tcp.rs +++ b/crates/shadowsocks-service/src/local/tun/tcp.rs @@ -388,7 +388,11 @@ impl TcpTun { && !socket.may_recv() && !matches!( socket.state(), - TcpState::SynReceived | TcpState::Established | TcpState::FinWait1 | TcpState::FinWait2 + TcpState::Listen + | TcpState::SynReceived + | TcpState::Established + | TcpState::FinWait1 + | TcpState::FinWait2 ) { trace!("closed TCP Read Half, {:?}", socket.state());