oktun tcp over kcp(udp) 服务

178次阅读
没有评论

共计 1042 个字符,预计需要花费 3 分钟才能阅读完成。

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
正文完
 
admin
版权声明:本站原创文章,由 admin 2022-02-20发表,共计1042字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
评论(没有评论)
验证码