Code Monkey home page Code Monkey logo

xkcptun's Issues

FEC 支持

与 kcptun 不兼容的主要问题是协议和 forward error correction 的问题,请问有支持的计划么

Ubuntu 14.04 LTS下编译完libevent2和json-c还需要加入下面3行

Hi Liu,
我在Ubuntu 14.04 LTS下server端编译完libevent2和json-c还需要加入下面3行才能运行:
ln -s /usr/local/lib/libevent-2.2.so.1 /usr/lib/libevent-2.2.so.1
ln -s /usr/local/lib/libevent-2.2.so.3 /usr/lib/libevent-2.2.so.3
ln -s /usr/local/lib/libjson-c.so.3 /usr/lib/libjson-c.so.3
我在跑youtube测试,配合ssr可以reach 10M-15Mbps左右。4k很勉强,2k没问题。有时会出现切换视频卡死,需要重启server端。大概是vps比较烂。
建议的话,希望直接在luci界面编辑client.json,这样比较方便2边参数同步,避免不必要的bug(我是把两边参数都配成一样再重启路由器运行的)。
Great thanks for your work!

搬瓦工服务器无任何回显

Centos 7 x86_64 bbr
./xkcp_server -c server.json -f -d 9

服务器端口12345已开放,单独测试ss无问题,本地树莓派server/client测试通过。但通过树莓派连接vps的时候,client有回显,server无任何回显

另外,luci界面下点击客户端的添加按钮无法跳转到服务器设置界面,删除完所有服务器列表也会出现这种情况,需要手动修改 /etc/config/shadowsocksr,这算是BUG吗?

server.json:
{
"localinterface": "venet0",
"localport": 12345,
"remoteaddr": "vps-ip",
"remoteport": ss端口,
"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": 11111,
"remoteaddr": "vps-ip",
"remoteport": 12345,
"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
}

参数支持

你好,请问项目中对于像 mode、crypt、keepalive等参数的支持是没有实现么?
我看目前kcp中数据部分其实就是将tcp层的数据进行了相应的分段传输并没有对这部分数据进行加密保护对吧?

incompatible with kcptun-go

first of all, good job, liu!

Just tested xkcp v0.4.266 on my mt7620 route, xkcp_client works perfect with xkcp_server, but when I try to use xkcp_client to connect kcptun-go server v20170329, it not works. Attached my xkcp_client config file for your reference. Let me know if you need more data. Thanks!

{
"localinterface": "br0",
"localport": 12580,
"remoteaddr": "server ip",
"remoteport": 31197,
"key": "forfree",
"crypt": "salsa20",
"mode": "fast",
"mtu": 1350,
"sndwnd": 128,
"rcvwnd": 128,
"datashard": 0,
"parityshard": 0,
"dscp": 46,
"nocomp": true,
"acknodelay": false,
"nodelay": 0,
"interval": 20,
"resend": 2,
"nc": 1,
"sockbuf": 4194304,
"keepalive": 10
}

build下make失败这是什么回事?

root@qiang:~/xkcptun/build# make
[ 4%] Building C object CMakeFiles/xkcp_server.dir/xkcp_server.c.o
/root/xkcptun/xkcp_server.c:36:26: fatal error: event2/event.h: No such file or directory
#include <event2/event.h>
^
compilation terminated.
make[2]: *** [CMakeFiles/xkcp_server.dir/xkcp_server.c.o] Error 1
make[1]: *** [CMakeFiles/xkcp_server.dir/all] Error 2
make: *** [all] Error 2

请求2M的文件hang住

Hi,求教一下,curl指定本地的客户端作为代理,请求一个2m大小的文件就hang住了,但是开了前台可以看到服务端与客户端的包信息都在不停的刷,必现的,能否帮忙解答下呢,是我配置哪里有问题么,除了改了示例配置里面的addr和port别的没改

在路由器中自动退出

编译了一个for padavan的版本,但运行中总是意外推出,返回码141,加上debug参数也看不出所以然,如下:

[7][Mon Jun 12 20:42:13 2017]846 [0] xkcp_rcv_cb [3] len [1368] conv [23] kcp is [1]
[7][Mon Jun 12 20:42:13 2017]846 [0] xkcp_rcv_cb [3] len [48] conv [23] kcp is [1]
[7][Mon Jun 12 20:42:13 2017]846 [0] xkcp_rcv_cb [3] len [1400] conv [23] kcp is [1]
[7][Mon Jun 12 20:42:13 2017]846 [0] xkcp_rcv_cb [3] len [1368] conv [23] kcp is [1]
[6][Mon Jun 12 20:42:13 2017]846 xkcp_forward_data conv [23] client[18] send [1400]
[6][Mon Jun 12 20:42:13 2017]846 xkcp_forward_data conv [23] client[18] send [1296]
[7][Mon Jun 12 20:42:13 2017]846 [0] xkcp_rcv_cb [3] len [1400] conv [23] kcp is [1]
[6][Mon Jun 12 20:42:13 2017]846 xkcp_forward_data conv [23] client[18] send [1400]
[7][Mon Jun 12 20:42:13 2017]846 [0] xkcp_rcv_cb [3] len [1400] conv [23] kcp is [1]
[7][Mon Jun 12 20:42:13 2017]846 [0] xkcp_rcv_cb [3] len [1368] conv [23] kcp is [1]
[6][Mon Jun 12 20:42:13 2017]846 xkcp_forward_data conv [23] client[18] send [1400]
[6][Mon Jun 12 20:42:13 2017]846 xkcp_forward_data conv [23] client[18] send [1296]
[7][Mon Jun 12 20:42:13 2017]846 xkcp_output conv [23] fd [3] len [264], send datagram from 264
[7][Mon Jun 12 20:42:13 2017]846 [0] xkcp_rcv_cb [3] len [1400] conv [23] kcp is [1]
[6][Mon Jun 12 20:42:13 2017]846 xkcp_forward_data conv [23] client[18] send [1400]
[7][Mon Jun 12 20:42:13 2017]846 [0] xkcp_rcv_cb [3] len [1400] conv [23] kcp is [1]
[7][Mon Jun 12 20:42:13 2017]846 [0] xkcp_rcv_cb [3] len [1368] conv [23] kcp is [1]
[6][Mon Jun 12 20:42:13 2017]846 xkcp_forward_data conv [23] client[18] send [1400]
[6][Mon Jun 12 20:42:13 2017]846 xkcp_forward_data conv [23] client[18] send [1296]
[7][Mon Jun 12 20:42:13 2017]846 [0] xkcp_rcv_cb [3] len [1400] conv [23] kcp is [1]
[6][Mon Jun 12 20:42:13 2017]846 xkcp_forward_data conv [23] client[18] send [1400]
[7][Mon Jun 12 20:42:13 2017]846 [0] xkcp_rcv_cb [3] len [1368] conv [23] kcp is [1]
[6][Mon Jun 12 20:42:13 2017]846 xkcp_forward_data conv [23] client[18] send [1400]
[6][Mon Jun 12 20:42:13 2017]846 xkcp_forward_data conv [23] client[18] send [1296]
[7][Mon Jun 12 20:42:13 2017]846 [0] xkcp_rcv_cb [3] len [1400] conv [23] kcp is [1]
[6][Mon Jun 12 20:42:13 2017]846 xkcp_forward_data conv [23] client[18] send [1400]

kcp连接是怎么建立和关闭的?

看了一下代码,似乎只要用一个新的conv给对方发包,对方就直接接受了这个连接。
关闭的代码我也没看到,如果一边想要关闭kcp连接,那么它要怎么做才能通知对方让对方也关闭?
感觉像是依赖于keeplive超时?

centos6.5_32bit 上面编译报错

[root@localhost build]# make
Scanning dependencies of target xkcp_client
[ 4%] Building C object CMakeFiles/xkcp_client.dir/tcp_proxy.c.o
[ 9%] Building C object CMakeFiles/xkcp_client.dir/xkcp_client.c.o
[ 14%] Building C object CMakeFiles/xkcp_client.dir/xkcp_config.c.o
[ 19%] Building C object CMakeFiles/xkcp_client.dir/xkcp_util.c.o
/usr/src/xkcptun-master/xkcp_util.c: 在函数‘dump_task’中:
/usr/src/xkcptun-master/xkcp_util.c:228: 警告:格式‘%d’需要类型‘int’,但实参 5 的类型为‘IUINT32’
/usr/src/xkcptun-master/xkcp_util.c:228: 警告:格式‘%d’需要类型‘int’,但实参 6 的类型为‘IUINT32’
/usr/src/xkcptun-master/xkcp_util.c:228: 警告:格式‘%d’需要类型‘int’,但实参 7 的类型为‘IUINT32’
/usr/src/xkcptun-master/xkcp_util.c:228: 警告:格式‘%d’需要类型‘int’,但实参 8 的类型为‘IUINT32’
/usr/src/xkcptun-master/xkcp_util.c:228: 警告:格式‘%d’需要类型‘int’,但实参 9 的类型为‘IUINT32’
/usr/src/xkcptun-master/xkcp_util.c:228: 警告:格式‘%d’需要类型‘int’,但实参 10 的类型为‘IUINT32’
/usr/src/xkcptun-master/xkcp_util.c:228: 警告:格式‘%d’需要类型‘int’,但实参 11 的类型为‘IUINT32’
/usr/src/xkcptun-master/xkcp_util.c:228: 警告:格式‘%d’需要类型‘int’,但实参 12 的类型为‘IUINT32’
[ 23%] Building C object CMakeFiles/xkcp_client.dir/commandline.c.o
[ 28%] Building C object CMakeFiles/xkcp_client.dir/debug.c.o
[ 33%] Building C object CMakeFiles/xkcp_client.dir/ikcp.c.o
[ 38%] Building C object CMakeFiles/xkcp_client.dir/jwHash.c.o
[ 42%] Building C object CMakeFiles/xkcp_client.dir/json.c.o
/usr/src/xkcptun-master/json.c: 在函数‘new_value’中:
/usr/src/xkcptun-master/json.c:146: 警告:提领类型双关的指针将破坏强重叠规则
/usr/src/xkcptun-master/json.c: 在函数‘json_parse_ex’中:
/usr/src/xkcptun-master/json.c:408: 警告:提领类型双关的指针将破坏强重叠规则
/usr/src/xkcptun-master/json.c:417: 警告:提领类型双关的指针将破坏强重叠规则
[ 47%] Building C object CMakeFiles/xkcp_client.dir/xkcp_mon.c.o
Linking C executable xkcp_client
CMakeFiles/xkcp_client.dir/tcp_proxy.c.o: In function tcp_proxy_accept_cb': tcp_proxy.c:(.text+0x16): undefined reference to evconnlistener_get_base'
tcp_proxy.c:(.text+0x2a): undefined reference to bufferevent_socket_new' CMakeFiles/xkcp_client.dir/xkcp_client.c.o: In function client_main_loop':
xkcp_client.c:(.text+0x1a9): undefined reference to evconnlistener_new_bind' xkcp_client.c:(.text+0x209): undefined reference to event_assign'
xkcp_client.c:(.text+0x237): undefined reference to event_new' xkcp_client.c:(.text+0x25d): undefined reference to evconnlistener_free'
xkcp_client.c:(.text+0x26b): undefined reference to evconnlistener_free' CMakeFiles/xkcp_client.dir/xkcp_util.c.o: In function xkcp_forward_data':
xkcp_util.c:(.text+0x27d): undefined reference to bufferevent_getfd' xkcp_util.c:(.text+0x2c1): undefined reference to bufferevent_get_output'
CMakeFiles/xkcp_client.dir/xkcp_util.c.o: In function dump_task_list': xkcp_util.c:(.text+0x3e1): undefined reference to bufferevent_get_output'
xkcp_util.c:(.text+0x437): undefined reference to bufferevent_getfd' CMakeFiles/xkcp_client.dir/xkcp_util.c.o: In function xkcp_tcp_read_cb':
xkcp_util.c:(.text+0x507): undefined reference to bufferevent_get_input' xkcp_util.c:(.text+0x537): undefined reference to bufferevent_getfd'
CMakeFiles/xkcp_client.dir/xkcp_util.c.o: In function xkcp_tcp_event_cb': xkcp_util.c:(.text+0x604): undefined reference to bufferevent_getfd'
xkcp_util.c:(.text+0x6b9): undefined reference to bufferevent_getfd' CMakeFiles/xkcp_client.dir/xkcp_mon.c.o: In function get_client_info':
xkcp_mon.c:(.text+0x44): undefined reference to bufferevent_get_output' CMakeFiles/xkcp_client.dir/xkcp_mon.c.o: In function get_server_status':
xkcp_mon.c:(.text+0xf4): undefined reference to bufferevent_get_output' CMakeFiles/xkcp_client.dir/xkcp_mon.c.o: In function set_xkcp_mon_listener':
xkcp_mon.c:(.text+0x219): undefined reference to evconnlistener_new_bind' CMakeFiles/xkcp_client.dir/xkcp_mon.c.o: In function xkcp_mon_accept_cb':
xkcp_mon.c:(.text+0x2c5): undefined reference to evconnlistener_get_base' xkcp_mon.c:(.text+0x2d9): undefined reference to bufferevent_socket_new'
CMakeFiles/xkcp_client.dir/xkcp_mon.c.o: In function xkcp_mon_write_cb': xkcp_mon.c:(.text+0x39e): undefined reference to bufferevent_get_output'
xkcp_mon.c:(.text+0x3a6): undefined reference to evbuffer_get_length' CMakeFiles/xkcp_client.dir/xkcp_mon.c.o: In function xkcp_mon_read_cb':
xkcp_mon.c:(.text+0x406): undefined reference to bufferevent_get_input' xkcp_mon.c:(.text+0x410): undefined reference to evbuffer_get_length'
collect2: ld 返回 1
make[2]: *** [xkcp_client] 错误 1
make[1]: *** [CMakeFiles/xkcp_client.dir/all] 错误 2
make: *** [all] 错误 2
[root@localhost build]# find / -name aclocal
/usr/share/aclocal
/usr/local/mysql/share/aclocal
/usr/bin/aclocal
[root@localhost build]#

Could you fix this error ?

I am using ASUS router and entware-ng.

I did compile xkcptun for entware-ng but its performance very poor compare with original kcptun.

Maybe it seems to relate with warning during cross-compiling.

http://imgur.com/a/jRcTO

err old client

client :LEDE Router firmware Cross compile xkcptun
server:Centos6 compile xkcptun
An error occurred when the client connects to the server
[7][Tue May 2 11:14:47 2017]24857 accept_new_client: [10.10.10.204:38651] conv [33554432] len [606]
[7][Tue May 2 11:14:47 2017]24857 get_task_from_conv [33554432]
[7][Tue May 2 11:14:47 2017]24857 old client, task is 1
[6][Tue May 2 11:14:47 2017]24857 [33554432] ikcp_input failed [-2]
[7][Tue May 2 11:14:47 2017]24857 accept_client_data: xkcp_forward_all_data ..

I use the source code is the same

xkcptun 斐讯k2p cpu占用100%

调节窗口大小,将加密改为none都不能改善。。求如何正确使用
server:
{
"localinterface": "eth0",
"localport": 29900,
"remoteaddr": "127.0.0.1",
"remoteport": 12948,
"key": "xxxxxxxx",
"crypt": "none",
"mode": "fast2",
"mtu": 1350,
"sndwnd": 128,
"rcvwnd": 56,
"datashard": 0,
"parityshard": 0,
"dscp": 0,
"nocomp": true,
"acknodelay": false,
"nodelay": 0,
"interval": 20,
"resend": 2,
"nc": 1,
"sockbuf": 4194304,
"keepalive": 10
}
~
clent:
{
"localinterface": "lo",
"localport": 12948,
"remoteaddr": "xxxxxxx",
"remoteport": 29900,
"key": "xxxxxxxx",
"crypt": "none",
"mode": "fast2",
"mtu": 1350,
"sndwnd": 56,
"rcvwnd": 128,
"datashard": 0,
"parityshard": 0,
"dscp": 0,
"nocomp": true,
"acknodelay": false,
"nodelay": 0,
"interval": 20,
"resend": 2,
"nc": 1,
"sockbuf": 4194304,
"keepalive": 10,
}

Idle情况下CPU占用率过高

padavan mt7621 cpu占用一直在7~15%左右,即使没流量也是如此,这不大正常吧?配置如下
router

{
"localinterface": "lo",
"localport": 12990,
"remoteaddr": "xxx",
"remoteport": 19089,
"key": "notused",
"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,
}

PC上没流量cpu占用差不多也有3~5%, 这对于一个守护进程来说,没数据大部分时间应该都在休眠,即使有些周期性的计算也不至于占这么多的CPU,是哪里有问题?
pc

支持ipv6吗?

今天在vps上测试了下,
在ipv4下正常工作,
ipv6下不行
vps的ipv6是确认正常的。

如何在服务端配置?

我找了很久在服务端配置的相关文章,只找到了一篇,但是并不完整,无法配置成功。问一下有没有一键脚本或者,其他详细的资料,在xkcptun中关于centos的搭建已经丢失。这个Xkcptun不在更新改进了么?

iOS

Support iOS?

why start a new project named xkcptun

any diff from kcptun?
it's more popular using kcptun, and xkcptun is not compatible with kcptun.
i use the K2 , i installed kcptun in my linux server, but i can not get connect with it because the author did not use kcptun but xkcptun.

如何在搬瓦工VPS部署服务器端

路由器固件自带xkcptun,不懂服务器端如何部署,请帮忙科普下,谢谢

下边这段说明是部署方法吗?

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

传输大文件时效率没有kcptun-go好,只有几KB

服务端配置如下:

{
"localinterface": "venet0:0",
"localport": 20022,
"remoteaddr": "127.0.0.1",
"remoteport": 22,
"crypt": "none",
"mode": "fast2",
"mtu": 1180,
"sndwnd": 2048,
"rcvwnd": 2048,
"dscp": 46,
"key": "xxx"
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.