Tunnel tcp through NKN client.
Tunnel any TCP applications through NKN client or Tuna. A few advantages:
A diagram of the default NKN client mode:
A - ... - X
/ \
Alice <--> TCP <--> NKN client - B - ... - Y - NKN client <--> TCP <--> Bob
\ /
C - ... - Z
A diagram of the Tuna mode:
A
/ \
Alice <--> TCP <--> NKN Tuna client - B - NKN Tuna client <--> TCP <--> Bob
\ /
C
go build -o nkn-tunnel bin/main.go
"Server" side:
./nkn-tunnel -to 127.0.0.1:8080 -s <seed>
and you will see an output like Listening at xxx
where xxx
is the server
listening address.
"Client" side:
./nkn-tunnel -from 127.0.0.1:8081 -to <server-listening-address>
Now any TCP connection to client port 8081 will be forwarded to server port 8080.
Add -tuna
on both side of the tunnel to use Tuna mode, which has much better
performance but requires listener to pay NKN token directly to Tuna service
providers.
When using Tuna mode, add -udp
to turn on UDP communication on both side to support UDP communication.
Can I submit a bug, suggestion or feature request?
Yes. Please open an issue for that.
Can I contribute patches?
Yes, we appreciate your help! To make contributions, please fork the repo, push your changes to the forked repo with signed-off commits, and open a pull request here.
Please sign off your commit. This means adding a line "Signed-off-by: Name
git commit -s