A simple tunnel (tcp + udp) writed with go.
To install this package, you need to install Go and set your Go workspace first.
- The first need Go installed (version 1.11+ is required), then you can use the below Go command to install tunnel.
$ go get -u github.com/jummyliu/tunnel@master
$ tunnel -h
Usage:
tunnel [-h]
tunnel [-t|-tcp <tunnelinfo>]... [-u|-udp <tunnelinfo>]... [-a|-all <tunnelinfo>]...
tunnel
Params:
-t | -tcp <tunnelinfo>
create a tcp tunnel with tunnelinfo
-u | -udp <tunnelinfo>
create a udp tunnel with tunnelinfo
-a | -all <tunnelinfo>
create both tcp and udp tunnel with tunnelinfo
-h help
<tunnelinfo>
sip:sport=dip:dport
sip:sport=dport
sport=dip:dport
sport=dport
port
- default sip is <0.0.0.0>
- default dip is <localhost>
$ tunnel -tcp 3306
proxy (tcp) 0.0.0.0:3306 => localhost:3306
$ tunnel -udp 8080
proxy (udp) 0.0.0.0:8080 => localhost:8080
$ tunnel -a 443
proxy (udp) 0.0.0.0:443 => localhost:443
proxy (tcp) 0.0.0.0:443 => localhost:443