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.
How to build
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
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
macOS
Set system DNS server. Please add DNS server to ip_cidr_rules.proxy for diverting all DNS queries to shadow.
请发表评论