GithubHelp home page GithubHelp logo

lubyruffy / shadow Goto Github PK

View Code? Open in Web Editor NEW

This project forked from imgk/shadow

0.0 1.0 0.0 2.67 MB

A transparent proxy for Windows, Linux, macOS

License: GNU General Public License v3.0

Go 99.70% HTML 0.30%

shadow's Introduction

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

shadow's People

Contributors

imgk avatar leiless avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.