A transparent proxy client for Windows, Linux and macOS, which now supports shadowsocks, trojan, socks5, http and wireguard, as well as all methods supported by v2ray.
Build with Go 1.16.
Replace $(proto)
with names of proxies which you want to use. Currently shadow supports socks
, shadowsocks
, trojan
, http
, wireguard
or v2ray
.
# linux darwin windows,wintun
go get -v -ldflags="-s -w" -trimpath -tags="$(proto)" github.com/imgk/shadow
# windows,windivert
go get -v -ldflags="-s -w" -trimpath -tags="divert $(proto)" github.com/imgk/shadow
-> ~ go/bin/shadow -h
Usage of go/bin/shadow:
-c string
config file (default "config.json")
-t duration
timeout (default 3m0s)
-v enable verbose mode
For WinTun, download WinTun and put wintun.dll
in C:\Windows\System32
.
For WinDivert, download WinDivert 2.2 and put WinDivert.dll
and WinDivert64.sys
in C:\Windows\System32
.
Use shadow with simple GUI shadow-windows.
Run shadow.exe with administrator privilege.
go/bin/shadow.exe -c C:/Users/example/shadow/config.json -v
- Set system DNS server. Please add DNS server to
ip_cidr_rules.proxy
for diverting all DNS queries to shadow.
sudo go/bin/shadow -c /etc/shadow.json -v
If you are using OpenWrt, you need to configure firewall.
# set tun name in the config.json
export TunName=utun
# configure firewall for OpenWrt
iptables -I FORWARD -o $TunName -j ACCEPT
iptables -t nat -I POSTROUTING -o $TunName -j MASQUERADE
- Set system DNS server. Please add DNS server to
ip_cidr_rules.proxy
for diverting all DNS queries to shadow.
sudo go/bin/shadow -c /etc/shadow.json -v
Please read doc/README.md
- Set interface IPv6 address and IPv6 routes