MCPcopy Index your code
hub / github.com/FlowerWrong/tun2socks

github.com/FlowerWrong/tun2socks @0.7

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.7 ↗ · + Follow
185 symbols 435 edges 41 files 83 documented · 45% updated 7y agov0.5 · 2019-02-14★ 42911 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

README

How to use it? more

# install golang 1.9+, becase of sync.Map
go get -u -v github.com/FlowerWrong/tun2socks
cd tun2socks
go get ./...

cp config.example.ini config.ini
# edit it for free
sudo go run cmd/main.go --config=config.ini

Support operating system.

  • [x] macOS
  • [x] linux
  • [x] Windows Vista and above support with tap-windows6, download link
  • [x] Raspberry Pi support
  • [x] android support with root

Hot reload config with USR2 signal. Not support windows.

Support route, udp.proxy, proxy, pattern and rule, see config.example.ini.

sudo kill -s USR2 $PID

NOTE: go run not support kill command signal.

As a static library

See c api wiki.

Windows build need to install git + tdm-gcc.

TODO

  • [ ] gui
  • [ ] ipv6 support

Thanks

Extension points exported contracts — how you extend this code

Pattern (Interface)
Pattern interface [4 implementers]
dns/pattern.go

Core symbols most depended-on inside this repo

Close
called by 15
tun2socks/udp2socks5.go
Close
called by 13
tun2socks/tcp2socks.go
Name
called by 11
dns/pattern.go
Proxy
called by 7
dns/pattern.go
Parse
called by 7
configure/config.go
ExecCommand
called by 6
util/cmd.go
Wrap
called by 6
util/wait_group_wrapper.go
Stop
called by 5
tun2socks/app.go

Shape

Method 83
Function 74
Struct 25
TypeAlias 2
Interface 1

Languages

Go98%
C2%

Modules by API surface

dns/pattern.go35 symbols
configure/config.go16 symbols
dns/table.go15 symbols
tun2socks/tcp2socks.go10 symbols
tun2socks/app.go8 symbols
dns/fake.go8 symbols
tun2socks/udp2socks5.go6 symbols
dns/rule.go6 symbols
dns/ip_pool.go6 symbols
configure/proxies.go6 symbols
cmd/main.go6 symbols
util/ip.go5 symbols

For agents

$ claude mcp add tun2socks \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact