• Stars
    star
    460
  • Rank 95,202 (Top 2 %)
  • Language
    C
  • License
    GNU General Publi...
  • Created over 7 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

xkcptun is kcp tunnel for OpenWRT&LEDE, implemented in c language

xkcptun

Build Status Powered license PRs Welcome Issue Welcome OpenWRT KunTeng

xkcptun 基于kcp和libevent2库,用c语言实现的kcptun

xkcptun主要应用于LEDE,openwrt中,其原理如图:

kcptun

Compile

xkcptun依赖libevent2

安装libevent2库后 (apt-get install libevent-dev)

git clone https://github.com/liudf0716/xkcptun.git

cd xkcptun

mkdir build && cd build

cmake .. (camke -DBUILD_STATIC_LINK=yes .. //静态链接)

make

生成xkcp_client, xkcp_server, xkcp_spy

参考文档

1, 安装libjson c的问题

2, bbr vs kcp 优化http下载性能对比报告

3, 如何在centos上部署xkcptun server

OpenWrt

编译及安装请参考 openwrt-xkcptun

QuickStart

为方便理解和使用,我们将使用场景放在同一台pc上,pc使用ubuntu系统,我们通过xkcptun来访问本机的http server

假设pc的 eth0 ip 为 192.168.199.18, http server的监听端口为80端口,xkcptun的server和client配置分别如下:

server.json 如下:

{
  "localinterface": "eth0",
  "localport": 9089,
  "remoteaddr": "192.168.199.18",
  "remoteport": 80,
  "key": "14789632a",
  "crypt": "none",
  "mode": "fast3",
  "mtu": 1350,
  "sndwnd": 1024,
  "rcvwnd": 1024,
  "datashard": 10,
  "parityshard": 3,
  "dscp": 0,
  "nocomp": true,
  "acknodelay": false,
  "nodelay": 0,
  "interval": 20,
  "resend": 2,
  "nc": 1,
  "sockbuf": 4194304,
  "keepalive": 10
}

client.json如下:

{
  "localinterface": "eth0",
  "localport": 9088,
  "remoteaddr": "192.168.199.18",
  "remoteport": 9089,
  "key": "14789632a",
  "crypt": "none",
  "mode": "fast3",
  "mtu": 1350,
  "sndwnd": 1024,
  "rcvwnd": 1024,
  "datashard": 10,
  "parityshard": 3,
  "dscp": 0,
  "nocomp": true,
  "acknodelay": false,
  "nodelay": 0,
  "interval": 20,
  "resend": 2,
  "nc": 1,
  "sockbuf": 4194304,
  "keepalive": 10
}

分别运行:

xkcp_server -c server.json -f -d 7

xkcp_client -c client.json -f -d 7

[注] 以上命令都是运行在debug和前台运行模式,正式部署的时候要把 -f 去掉, -d 0 如: xkcp_server -c server.json -d 0

curl http://192.168.199.18:9088

其执行效果与curl http://192.168.199.18 等同

xkcp_spy -h 192.168.199.18 -s -t status

查看服务器端的情况

xkcp_spy -h 192.168.199.18 -c -t status

查看客户端的情况

Todo

Compatible with kcptun kcptun

How to contribute our project(给本项目做贡献)

欢迎大家给本项目提供意见和贡献,提供意见的方法可以在本项目的Issues提,更加欢迎给项目提PULL REQUEST,具体提交PR的方法请参考CONTRIBUTING

Contact me

QQ群 : 331230369

More Repositories

1

apfree-wifidog

Secure and streamline your wireless networks with apfree-wifidog: a high-performance, lightweight captive portal solution optimized for both HTTP and HTTPS traffic.
C
822
star
2

xfrpc

The xfrpc project is a lightweight implementation of the FRP client written in C language for OpenWRT and IoT systems. It is designed to provide an efficient solution for resource-constrained devices such as OpenWRT routers and IoT devices, which often have limited ROM and RAM space.
C
711
star
3

wwas

apfree-wifidog auth server
JavaScript
76
star
4

wwas-admin

apfree wifidog auth server admin ui
Vue
26
star
5

luci-app-xfrpc

luci for xfrpc
JavaScript
13
star
6

gptwrt

支持国内chatgpt访问的openwrt固件
9
star
7

rust-frp-client

frp client implemented with rust language
Rust
8
star
8

udpi

fork from vpp's udpi project
C
8
star
9

apfree_wifidog

clone from apfree-wifidog
C
5
star
10

luci-app-apfree-wifidog

luci for apfree-wifidog
JavaScript
5
star
11

actions-apfree-wifidog

github action 编译openwrt x86_64带apfree-wifidog 最新版本
Makefile
4
star
12

liudf0716

about me
3
star
13

xfrps

xfrpc的服务端代码,golang实现,基于frp v0.11.0 实现
Go
3
star
14

action-xfrpc

action for chatgpt-wrt to access chatgpt service without block
2
star
15

ax9000-openwrt

如何在ax9000上安装openwrt
2
star
16

be-hacked-daily

记录pc被黑的日常
2
star
17

doprax-for-chatgptwrt

doprax for chatgptwrt
Dockerfile
2
star
18

funny-project

收集一些有意思的开源项目
2
star
19

qq-group-material

区块链技术研究院qq群资料
1
star
20

vpp-wrt

vpp base wrt router
Shell
1
star
21

vpp-wrt-ui

frontend for vpp-wrt
Vue
1
star
22

actions-vpp

actions for vpp
1
star
23

action-vpp-wrt-base

action for vpp-agent
1
star
24

iptables-apfree-wifidog

iptables v1.8.6 for apfree wifidog
C
1
star
25

vpp-wrt-admin

vpp-wrt backend module
JavaScript
1
star
26

chatgpt-for-racknerd

service in racknerd for chatgpt-wrt
Shell
1
star
27

action-openwrt-r7800

github action for build openwrt r7800 firmware
Shell
1
star
28

luci-app-yt-dlp

luci application for yt-dlp
JavaScript
1
star