oktun是开源的tcp over kcp服务,提供客户端监听tcp端口,通过kcp协议转发到服务端,服务端监听kcp,转发至对于tcp服务,GitHub地址:oolongmen/oktun: tcp over kcp tunnel (github.com)
经过测试,本机转发效率在1G带宽,kcp协议参数需要做具体优化
+--------+ +------------+ +------------+ +----+ | TARGET | <-----> | Tun Server | <-----> | Tun Client | <-----> | PC | +--------+ +------------+ +------------+ +----+ ^ ^ | | +----+ | +-------------> | PC | | +----+ | | +------------+ +----+ +---------------| Tun Client | <-----> | PC | +------------+ +----+
Dependencies
c++11 libevent2
Build
mkdir build cd build; cmake .. make
Usage
ex:
Remote PC @ 11.22.33.44 Target Webserver @ port #8080
Remote PC
./oktun_server -b 51024 -r :8080
Client PC
./oktun_client -b 51024 -r 8888 -s 11.22.33.44:51024
Connect to target webserver via http://localhost:8888 from client pc
oktun_server
Usage: oktun_server [options] Options: -h, --help Print this help. -b, --bind [int] Local port to bind. -r, --remoteaddr [host:port] Address of remote server to forward request to.
oktun_client
Usage: oktun_client [options] Options: -h, --help Print this help. -b, --bind [int] Local port to bind. -s, --serveraddr [host:port] Address of oktun server. -r, --proxyport [int] Local port to listen for proxy request