静看光阴荏苒
不管不顾不问不说也不念

游戏福音:kcptun+udp2raw解决udp干扰/QoS

2023年10月21日更新,打个小广告:

本人现承接代搭建MapleStory GMS(冒险岛国际服)游戏加速器业务。

如果你是小白不知道如何操作Linux系统,又或者没有时间折腾这些东西只想安心玩游戏,可以联系我有偿帮你搭建。

请注意我给你部署的方法并不是文章内公开的方法,而是更好用更稳定的方法。我可以做出以下几点保证:

1、你的游戏账号不会被IP连坐封号。

2、使用NexonLauncher启动器不会弹出需要验证邮箱的提示。

3、比市面上的游戏加速器玩起来更流畅,你不会感觉到卡顿、延迟。

你可以在这里下单购买:https://shop.meows.lol/MapleStory

目前在线支付只支持PayPal付款,如果你没有PayPal可以工单联系我,我可以发支付宝二维码给你付款。如果你不知道如何在上述网站发工单也可以直接在这篇文章下留言。

在你购买前需要注意以下几点:

1、你可以自备VPS服务器,我只负责帮你在VPS服务器上部署程序。你也可以选择让我准备VPS服务器,即一条龙服务,所有的东西都交给我处理。根据你自身的需求来下单。

2、如果你自备VPS服务器,请确保服务器IP位于北美范围内,例如美国、加拿大。

3、自备VPS服务器一次性收费12美元,如果你使用支付宝付款则按当天的美元兑人民币汇率来计算。

4、一条龙服务一次性收费12美元,每月收费8美元(VPS服务器每月续费)。

5、只支持使用NexonLauncher启动器,如果你使用Steam请事先切换到NexonLauncher启动器。

——————————————————–分隔线——————————————————–

情况是这样,我最近拿kcptun+sstap用于游戏加速,稳定了大概2-3天的样子,具体的配置过程可以看这篇文章:

自建冒险岛国际服(GMS)游戏加速器

自从上了kcptun,玩这种美服游戏就感觉在玩国服,几乎感觉不到什么延时,然而好景不长。。延时的问题算是解决了,但新的问题粗来了。。

最近这几天经常会出现kcptun断流的问题,具体表现是kcptun这边不报任何错误,但经过kcptun的流量就是无法到达对端,基本上只要断流了就要等个几分钟才能恢复(或者根本恢复不了,就像黑名单了一样)。

最直观的是在sstap上测试连接,走了kcptun的流量全部连接都被服务器放弃:

如果这时候直接连接ss的话是没有问题的,所以我初步怀疑是电信运营商QoS了。

后续我将宽带IP重新拨号,只要换一个IP就能立马连上,所以基本可以断定是电信这边搞的鬼。

我寻思我就每天拿来玩下游戏,一天下来用的流量也不超过2GB,你这样搞,简直没有人性啊!TM的一个月125的宽带这点UDP流量都不让跑?

没办法,kcptun这个东西我必须要用,所以只能在kcptun前面再套一个udp2raw解决运营商的QoS问题了。

其实说实话,这样配置起来的话我自己都觉得有点麻烦了,这套那套的。。端口用了一堆,软件也开了一堆。。对于新手来说肯定是极其不友好,所以我建议萌新如果怕麻烦,直接花钱买现成的服务吧。。。(不过买的肯定没这样配置的好用)

首先要准备一堆软件:

https://github.com/xtaci/kcptun/releases # 服务端和客户端都要下载
https://github.com/dfdragon/kcptun_gclient/releases # 客户端下载
https://github.com/wangyu-/udp2raw-tunnel/releases # 服务端下载
https://github.com/wangyu-/udp2raw-multiplatform/releases # 客户端下载
https://github.com/wangyu-/tinyPortMapper/releases # 客户端下载
https://github.com/mayunbaba2/SSTap-beta-setup # 客户端下载

以下步骤在Debian10上完成。其他系统除了supervisor的配置文件路径有点变化外基本也一样。

安装ss和一些工具:

apt -y update
apt -y install shadowsocks-libev supervisor wget nano

下载kcptun:

mkdir -p /opt/kcptun && cd /opt/kcptun
wget https://github.com/xtaci/kcptun/releases/download/v20190924/kcptun-linux-amd64-20190924.tar.gz
tar -xzvf kcptun-linux-amd64-20190924.tar.gz
chmod +x server_linux_amd64

下载udp2raw:

mkdir -p /opt/udp2raw && cd /opt/udp2raw
wget https://github.com/wangyu-/udp2raw-tunnel/releases/download/20190716.test.0/udp2raw_binaries.tar.gz
tar -xzvf udp2raw_binaries.tar.gz
chmod +x udp2raw_amd64

编辑ss的配置文件:

nano /etc/shadowsocks-libev/config.json

修改为:

{
    "server": "0.0.0.0",
    "mode":"tcp_and_udp",
    "server_port":12315,
    "local_port":1080,
    "password":"设置你的ss密码",
    "timeout":60,
    "method":"chacha20-ietf-poly1305"
}

重启ss以及设置ss开机自启:

systemctl restart shadowsocks-libev
systemctl enable shadowsocks-libev

新建kcptun配置文件:

nano /opt/kcptun/server-config.json

写入如下配置(MTU设置为1300或者更小):

{
"listen": ":30000",
"target": "127.0.0.1:12315",
"key": "设置一个密码",
"crypt": "salsa20",
"mode": "fast3",
"mtu": 1300,
"sndwnd": 1024,
"rcvwnd": 1024,
"datashard": 2,
"parityshard": 2,
"dscp": 46,
"nocomp": true
}

注:这套是游戏加速的配置,如果是看Youtube视频等大流量应用,需要把datashard以及parityshard适当增大。

新建一个kcptun的supervisor配置文件:

nano /etc/supervisor/conf.d/kcptun.conf

写入:

[program:kcptun]
priority=1
directory=/opt/kcptun
command=/opt/kcptun/server_linux_amd64 -c /opt/kcptun/server-config.json
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/supervisor/kcptun.log

再新建一个udp2raw的supervisor配置文件:

nano /etc/supervisor/conf.d/udp2raw.conf

写入如下配置:

[program:udp2raw]
user=root
priority=1
directory=/opt/udp2raw
command=/opt/udp2raw/udp2raw_amd64 -s -l 0.0.0.0:30001 -r 127.0.0.1:30000 --raw-mode faketcp -a -k "设置一个你的密码"
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/supervisor/udp2raw.log

更新supervisor配置/开机自启:

supervisorctl update
systemctl enable supervisor

服务端这边的配置就完成了,接下来是客户端的。

首先用管理员权限开2个powershell,进入到软件的根目录:

cd C:\Users\LALA\Desktop\udp

第一个powershell运行tinyPortMapper用来转发UDP流量:

.\tinymapper_wepoll.exe -l 0.0.0.0:9527 -r VPS公网IP:12315 -u

这步的作用仅仅只是为了让SSTap能够测试通过UDP转发,让其能够可以连接代理服务器,对于使用TCP协议进行连接的游戏而言这个操作没有实际意义。

第二个powershell运行udp2raw的windows客户端:

.\udp2raw_mp_nolibnet.exe -c -r VPS公网IP:30001 -l 0.0.0.0:5000 --raw-mode easyfaketcp -k "对应服务端上的udp2raw密码"

打开KCP客户端配置管理工具,新建一个客户端,按照下图配置:

传输模式和服务端上的配置对应这里选择fast3:

现在打开SSTap添加一个ss代理,配置如下:

最后点击SSTap的齿轮按钮,打开附加路由管理,在里面添加上你的VPS公网IP,动作选择直连:

没问题的话现在连上应该就OK了。

一点后续补充:

在本地每次都要开两个powershell感觉不优雅?这里其实可以用winSW把这两个命令行工具创建成windows服务,这样就能开机自启而且还不需要powershell了,具体的winSW用法,可以看这里,我实在没时间码字了,告辞:

https://github.com/kohsuke/winsw/blob/master/doc/installation.md

赞(2)
未经允许不得转载:荒岛 » 游戏福音:kcptun+udp2raw解决udp干扰/QoS
分享到: 更多 (0)

评论 17

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  1. #1

    dalao能讲讲udpspeeder吗 :cry:

    MU4年前 (2019-11-12) Google Chrome 78.0.3904.97 Google Chrome 78.0.3904.97 Windows 10 x64 Edition Windows 10 x64 Edition回复
    • 呃,建议你去看官方的wiki呢,可以说各种配置应有尽有,写的很详细了。

      LALA4年前 (2019-11-14) Google Chrome 74.0.3729.169 Google Chrome 74.0.3729.169 Windows 10 x64 Edition Windows 10 x64 Edition回复
  2. #2

    武汉移动这边也搞事啊,kcptun也不稳定

    光阴逆旅4年前 (2019-11-13) Google Chrome 78.0.3904.97 Google Chrome 78.0.3904.97 Windows 10 x64 Edition Windows 10 x64 Edition回复
    • 移动一直在搞事,从未停歇。。

      LALA4年前 (2019-11-14) Google Chrome 74.0.3729.169 Google Chrome 74.0.3729.169 Windows 10 x64 Edition Windows 10 x64 Edition回复
  3. #3

    :cool: 没吃上

    [00:29] 测试已开始.
    [00:29] 正在测试TCP数据传递…
    [00:34] 连接已被服务器放弃.
    [00:39] 连接已被服务器放弃.
    [00:44] 连接已被服务器放弃.
    [00:49] 连接已被服务器放弃.
    [00:49] 测试TCP数据传递…未通过!
    [00:49] 测试完成!
    [00:49] //////////////////////////////////////////////
    [00:49] 测试已开始.
    [00:49] 正在测试UDP转发…
    [00:49] 测试UDP转发…通过!
    [00:49] 测试完成!
    [00:49] //////////////////////////////////////////////

    小伙4年前 (2020-05-18) Google Chrome 74.0.3729.169 Google Chrome 74.0.3729.169 Windows 10 x64 Edition Windows 10 x64 Edition回复
  4. #4

    :eek: 旧版那个吃上了。 –。 :!:

    小伙4年前 (2020-05-18) Google Chrome 74.0.3729.169 Google Chrome 74.0.3729.169 Windows 10 x64 Edition Windows 10 x64 Edition回复
  5. #5

    大佬,我步骤进行到第二个powershell运行udp2raw的windows客户端的时候,一直显示cant not open wpcap.dll,make sure winpcap/npcap is installed怎么办啊

    a82596294年前 (2020-05-26) QQbrowser 9.0.2524.400 QQbrowser 9.0.2524.400 Windows 10 x64 Edition Windows 10 x64 Edition回复
    • 你电脑上要装winpcap这个软件

      LALA4年前 (2020-05-27) Google Chrome 80.0.3987.163 Google Chrome 80.0.3987.163 Windows 10 x64 Edition Windows 10 x64 Edition回复
  6. #6

    大佬你就不能弄个批处理吗~~~ :eek: :eek: :eek: :eek:

    路过4年前 (2020-05-27) Google Chrome 80.0.3987.132 Google Chrome 80.0.3987.132 Windows 10 x64 Edition Windows 10 x64 Edition回复
    • 配置一次就行了,后面我直接用winsw弄成服务就可以开机自启了,弄批处理是什么操作。。

      LALA4年前 (2020-05-27) Google Chrome 80.0.3987.163 Google Chrome 80.0.3987.163 Windows 10 x64 Edition Windows 10 x64 Edition回复
  7. #7

    大佬,服务器上的操作我都能懂,但客户端 我想在openwrt路由器上用,具体怎么操作啊?

    dm4年前 (2020-07-09) Google Chrome 83.0.4103.116 Google Chrome 83.0.4103.116 Windows 10 x64 Edition Windows 10 x64 Edition回复
    • 具体步骤评论这里也说不清楚,简单点的方法就是你直接下载对应架构的二进制文件然后在openwrt里面配置。。。我没有在openwrt上装过,但感觉步骤应该是差不多的。。。

      LALA4年前 (2020-07-10) Google Chrome 80.0.3987.163 Google Chrome 80.0.3987.163 Windows 10 x64 Edition Windows 10 x64 Edition回复
  8. #8

    有没有谁说一下参数该怎么填,又怎样知道udp2raw已经成功运行了?

    谁能帮我解决请一顿饭qq7931465633年前 (2020-12-18) Google Chrome 87.0.4280.88 Google Chrome 87.0.4280.88 Windows 7 x64 Edition Windows 7 x64 Edition回复
  9. #9

    大佬,开头要准备的那一堆软件怎么安装呀?
    https://github.com/xtaci/kcptun/releases # 服务端和客户端都要下载
    https://github.com/dfdragon/kcptun_gclient/releases # 客户端下载
    https://github.com/wangyu-/udp2raw-tunnel/releases # 服务端下载
    https://github.com/wangyu-/udp2raw-multiplatform/releases # 客户端下载
    https://github.com/wangyu-/tinyPortMapper/releases # 客户端下载
    https://github.com/mayunbaba2/SSTap-beta-setup # 客户端下载

    木子3年前 (2021-02-05) Google Chrome 81.0.4044.117 Google Chrome 81.0.4044.117 Android 10 Android 10回复
    • 抱歉,回复的比较晚了,最近没咋看博客。。这些软件准确点说都不需要安装,除了最后一个SSTap以外。直接下载对应你系统架构的压缩包解压就可以了。

      LALA3年前 (2021-02-11) Google Chrome 86.0.4240.198 Google Chrome 86.0.4240.198 Windows 10 x64 Edition Windows 10 x64 Edition回复
  10. #10

    求大佬指点, :cry: :cry:

    木子3年前 (2021-02-05) Google Chrome 81.0.4044.117 Google Chrome 81.0.4044.117 Android 10 Android 10回复

分享创造快乐

广告合作资源投稿