#508·wstunnel

多路径 TCP (MPTCP) + wstunnel

作者: devalexqt创建于 2026年5月21日更新于 2026年7月5日
标签bug

问题描述

在反向隧道模式中,我遇到了奇怪的问题:通过 curl 从 wstunnel 服务器上开始下载 1Gig 文件,但它以低速度开始,最高速度为 3Mbit/s,持续 20-60 秒,然后速度降至 0,持续 2-3 秒,然后速度快速提升到 1000Mbit/s,并保持到文件下载结束。 这种情况只发生在下载速度上!上传速度正常,并且在启动时达到最大通道速度。

重现步骤

从源代码构建 wstunnel(wstunnel-cli 10.5.5)并通过 mptcpize run 运行反向隧道,因为 wstunnel 不支持 natively mptcp:

mptcpize run  /root/wstunnel/target/release/wstunnel server --restrict-http-upgrade-path-prefix htaz........................q4JNoycsW  wss://0.0.0.0:8443
mptcpize run /root/wstunnel/target/release/wstunnel client --http-upgrade-path-prefix htaz...............................q4JNoycsW -R 'tcp://[::]:8001:localhost:8000' wss://xxx.xxx.xxx.xxx6:8443

运行文件传输上传/下载(在服务器端使用反向代理隧道连接到本地服务器)

# 快速启动和快速速度
/snap/bin/curl -k -X POST -T local_test_1000.bin https://localhost:8001/upload -o /dev/null --http1.1
# 以大约 3Mbit/s 的速度开始,持续 60 秒,然后速度降至 0,然后开始以 1000Mbit/s 的速度传输。
/snap/bin/curl -k https://localhost:8001/download -o /dev/null --http1.1
Image Image

预期行为

文件传输上传/下载必须快速启动到最大通道速度。