shadow

command module
v0.0.0-...-8e6527b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

README

Shadow

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

How to use it

->  ~ 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
Windows

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.

GUI

Use shadow with simple GUI shadow-windows.

CLI

Run shadow.exe with administrator privilege.

go/bin/shadow.exe -c C:/Users/example/shadow/config.json -v
Linux and OpenWrt Router
  1. 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
  1. 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

Documentation

Please read doc/README.md

TODO

  • Set interface IPv6 address and IPv6 routes

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
divert/filter/iptree
Package iptree implements radix tree data structure for IPv4 and IPv6 networks.
Package iptree implements radix tree data structure for IPv4 and IPv6 networks.
tun
protocol module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL