Describe the bug
I am trying run a complex path setup.
wireguard client -> wstunnel client -> nginx reverse proxy no buffering tls termination -> envoy proxy no buffering -> wstunnel server -> wireguard server
i observed so bad performance than the expected one.
i am testing with starlink and 4G networks.
On startlink there is 1/3 lost of speed ratio. for 4G the download speed is around 128KB/s and upload speed 3MB/s :) very weird
so i decided to test the wstunnel with iperf3.
To Reproduce
Steps to reproduce the behavior:
on server i run
iperf3 -s -p 5201
wstunnel server ws:0.0.0.0:54611 --restrict-http-upgrade-path-prefix *******
on client
wstunnel client \ -L "tcp://5201:127.0.0.1:5201" \ --http-upgrade-path-prefix ****** \ ws://x.x.x.x:54611
iperf3 -c 127.0.0.1 -p 5201 -t 30 -b 50M
Results on Starlink only
### Download via wstunnel test
iperf3 -c 127.0.0.1 -p 5201 -t 30 -b 50M -R
Connecting to host 127.0.0.1, port 5201
Reverse mode, remote host 127.0.0.1 is sending
[ 5] local 127.0.0.1 port 51236 connected to 127.0.0.1 port 5201
[ ID] Interval Transfer Bitrate
[ 5] 0.00-1.00 sec 512 KBytes 4.19 Mbits/sec
[ 5] 1.00-2.00 sec 3.50 MBytes 29.4 Mbits/sec
[ 5] 2.00-3.00 sec 10.0 MBytes 83.9 Mbits/sec
[ 5] 3.00-4.00 sec 8.63 MBytes 72.4 Mbits/sec
[ 5] 4.00-5.00 sec 4.00 MBytes 33.6 Mbits/sec
[ 5] 5.00-6.00 sec 8.25 MBytes 69.2 Mbits/sec
[ 5] 6.00-7.00 sec 6.25 MBytes 52.4 Mbits/sec
[ 5] 7.00-8.00 sec 4.75 MBytes 39.8 Mbits/sec
[ 5] 8.00-9.00 sec 7.75 MBytes 65.0 Mbits/sec
[ 5] 9.00-10.00 sec 6.00 MBytes 50.3 Mbits/sec
[ 5] 10.00-11.00 sec 5.88 MBytes 49.3 Mbits/sec
[ 5] 11.00-12.00 sec 6.00 MBytes 50.3 Mbits/sec
[ 5] 12.00-13.00 sec 6.00 MBytes 50.3 Mbits/sec
[ 5] 13.00-14.00 sec 6.00 MBytes 50.3 Mbits/sec
[ 5] 14.00-15.00 sec 5.88 MBytes 49.3 Mbits/sec
[ 5] 15.00-16.00 sec 6.00 MBytes 50.3 Mbits/sec
[ 5] 16.00-17.00 sec 5.88 MBytes 49.3 Mbits/sec
[ 5] 17.00-18.00 sec 6.06 MBytes 50.9 Mbits/sec
[ 5] 18.00-19.00 sec 5.81 MBytes 48.8 Mbits/sec
[ 5] 19.00-20.00 sec 6.12 MBytes 51.4 Mbits/sec
[ 5] 20.00-21.00 sec 5.75 MBytes 48.2 Mbits/sec
[ 5] 21.00-22.00 sec 5.00 MBytes 41.9 Mbits/sec
[ 5] 22.00-23.00 sec 4.00 MBytes 33.6 Mbits/sec
[ 5] 23.00-24.00 sec 9.00 MBytes 75.5 Mbits/sec
[ 5] 24.00-25.00 sec 6.00 MBytes 50.3 Mbits/sec
[ 5] 25.00-26.00 sec 6.00 MBytes 50.3 Mbits/sec
[ 5] 26.00-27.00 sec 5.88 MBytes 49.3 Mbits/sec
[ 5] 27.00-28.00 sec 6.00 MBytes 50.3 Mbits/sec
[ 5] 28.00-29.00 sec 6.00 MBytes 50.3 Mbits/sec
[ 5] 29.00-30.00 sec 6.00 MBytes 50.3 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-30.15 sec 180 MBytes 50.0 Mbits/sec 14 sender
[ 5] 0.00-30.00 sec 179 MBytes 50.0 Mbits/sec receiver
iperf Done.
### Upload via wstunnel Test
iperf3 -c 127.0.0.1 -p 5201 -t 30 -b 50M
Connecting to host 127.0.0.1, port 5201
[ 5] local 127.0.0.1 port 57756 connected to 127.0.0.1 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 6.00 MBytes 50.3 Mbits/sec 3 512 KBytes
[ 5] 1.00-2.00 sec 3.38 MBytes 28.3 Mbits/sec 0 576 KBytes
[ 5] 2.00-3.00 sec 128 KBytes 1.05 Mbits/sec 0 576 KBytes
[ 5] 3.00-4.00 sec 1.88 MBytes 15.7 Mbits/sec 0 576 KBytes
[ 5] 4.00-5.00 sec 0.00 Bytes 0.00 bits/sec 0 576 KBytes
[ 5] 5.00-6.00 sec 0.00 Bytes 0.00 bits/sec 0 576 KBytes
[ 5] 6.00-7.00 sec 0.00 Bytes 0.00 bits/sec 0 576 KBytes
[ 5] 7.00-8.00 sec 4.38 MBytes 36.7 Mbits/sec 0 831 KBytes
[ 5] 8.00-9.00 sec 0.00 Bytes 0.00 bits/sec 0 831 KBytes
[ 5] 9.00-10.00 sec 0.00 Bytes 0.00 bits/sec 0 831 KBytes
[ 5] 10.00-11.00 sec 0.00 Bytes 0.00 bits/sec 0 831 KBytes
[ 5] 11.00-12.00 sec 0.00 Bytes 0.00 bits/sec 0 831 KBytes
[ 5] 12.00-13.00 sec 0.00 Bytes 0.00 bits/sec 0 831 KBytes
[ 5] 13.00-14.00 sec 0.00 Bytes 0.00 bits/sec 0 831 KBytes
[ 5] 14.00-15.00 sec 0.00 Bytes 0.00 bits/sec 0 831 KBytes
[ 5] 15.00-16.00 sec 6.00 MBytes 50.3 Mbits/sec 0 959 KBytes
[ 5] 16.00-17.00 sec 0.00 Bytes 0.00 bits/sec 0 959 KBytes
[ 5] 17.00-18.00 sec 0.00 Bytes 0.00 bits/sec 0 959 KBytes
[ 5] 18.00-19.00 sec 0.00 Bytes 0.00 bits/sec 0 959 KBytes
[ 5] 19.00-20.00 sec 0.00 Bytes 0.00 bits/sec 0 959 KBytes
[ 5] 20.00-21.00 sec 0.00 Bytes 0.00 bits/sec 0 959 KBytes
[ 5] 21.00-22.00 sec 0.00 Bytes 0.00 bits/sec 0 959 KBytes
[ 5] 22.00-23.00 sec 0.00 Bytes 0.00 bits/sec 0 959 KBytes
[ 5] 23.00-24.00 sec 5.62 MBytes 47.2 Mbits/sec 0 1.12 MBytes
[ 5] 24.00-25.00 sec 256 KBytes 2.10 Mbits/sec 0 1.12 MBytes
[ 5] 25.00-26.00 sec 0.00 Bytes 0.00 bits/sec 0 1.12 MBytes
[ 5] 26.00-27.00 sec 0.00 Bytes 0.00 bits/sec 0 1.12 MBytes
[ 5] 27.00-28.00 sec 0.00 Bytes 0.00 bits/sec 0 1.12 MBytes
[ 5] 28.00-29.00 sec 0.00 Bytes 0.00 bits/sec 0 1.12 MBytes
[ 5] 29.00-30.00 sec 0.00 Bytes 0.00 bits/sec 0 1.12 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-30.00 sec 27.6 MBytes 7.72 Mbits/sec 3 sender
[ 5] 0.00-30.22 sec 13.6 MBytes 3.76 Mbits/sec receiver
iperf Done.
### Download direct test
iperf3 -c x.x.x.x -p 5201 -t 30 -b 50M -R
Connecting to host x.x.x.x, port 5201
Reverse mode, remote host x.x.x.x is sending
[ 5] local 192.168.1.50 port 54668 connected to 38.242.146.244 port 5201
[ ID] Interval Transfer Bitrate
[ 5] 0.00-1.00 sec 540 KBytes 4.42 Mbits/sec
[ 5] 1.00-2.00 sec 4.78 MBytes 40.1 Mbits/sec
[ 5] 2.00-3.00 sec 269 KBytes 2.20 Mbits/sec
[ 5] 3.00-4.00 sec 1.77 MBytes 14.8 Mbits/sec
[ 5] 4.00-5.00 sec 2.80 MBytes 23.5 Mbits/sec
[ 5] 5.00-6.00 sec 2.43 MBytes 20.4 Mbits/sec
[ 5] 6.00-7.00 sec 2.92 MBytes 24.5 Mbits/sec
[ 5] 7.00-8.00 sec 2.97 MBytes 24.9 Mbits/sec
[ 5] 8.00-9.00 sec 3.04 MBytes 25.5 Mbits/sec
[ 5] 9.00-10.00 sec 3.93 MBytes 33.0 Mbits/sec
[ 5] 10.00-11.00 sec 4.70 MBytes 39.5 Mbits/sec
[ 5] 11.00-12.00 sec 4.41 MBytes 37.0 Mbits/sec
[ 5] 12.00-13.00 sec 4.67 MBytes 39.2 Mbits/sec
[ 5] 13.00-14.00 sec 4.17 MBytes 35.0 Mbits/sec
[ 5] 14.00-15.00 sec 5.09 MBytes 42.7 Mbits/sec
[ 5] 15.00-16.00 sec 5.43 MBytes 45.6 Mbits/sec
[ 5] 16.00-17.00 sec 4.36 MBytes 36.6 Mbits/sec
[ 5] 17.00-18.00 sec 6.91 MBytes 58.0 Mbits/sec
[ 5] 18.00-19.00 sec 4.36 MBytes 36.6 Mbits/sec
[ 5] 19.00-20.00 sec 8.03 MBytes 67.4 Mbits/sec
[ 5] 20.00-21.00 sec 8.15 MBytes 68.4 Mbits/sec
[ 5] 21.00-22.00 sec 8.29 MBytes 69.5 Mbits/sec
[ 5] 22.00-23.00 sec 7.41 MBytes 62.1 Mbits/sec
[ 5] 23.00-24.00 sec 7.68 MBytes 64.4 Mbits/sec
[ 5] 24.00-25.00 sec 7.60 MBytes 63.8 Mbits/sec
[ 5] 25.00-26.00 sec 7.30 MBytes 61.3 Mbits/sec
[ 5] 26.00-27.00 sec 90.4 KBytes 741 Kbits/sec
[ 5] 27.00-28.00 sec 3.76 MBytes 31.6 Mbits/sec
[ 5] 28.00-29.00 sec 3.95 MBytes 33.2 Mbits/sec
[ 5] 29.00-30.00 sec 4.39 MBytes 36.8 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-30.15 sec 139 MBytes 38.6 Mbits/sec 4279 sender
[ 5] 0.00-30.00 sec 136 MBytes 38.1 Mbits/sec receiver
iperf Done.
### Upload direct test
iperf3 -c x.x.x.x -p 5201 -t 30 -b 50M
Connecting to host x.x.x.x, port 5201
[ 5] local 192.168.1.50 port 48032 connected to 38.242.146.244 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 544 KBytes 4.46 Mbits/sec 0 90.5 KBytes
[ 5] 1.00-2.00 sec 512 KBytes 4.19 Mbits/sec 1 76.4 KBytes
[ 5] 2.00-3.00 sec 512 KBytes 4.19 Mbits/sec 1 63.6 KBytes
[ 5] 3.00-4.00 sec 256 KBytes 2.10 Mbits/sec 1 52.3 KBytes
[ 5] 4.00-5.00 sec 256 KBytes 2.10 Mbits/sec 0 55.1 KBytes
[ 5] 5.00-6.00 sec 384 KBytes 3.15 Mbits/sec 0 55.1 KBytes
[ 5] 6.00-7.00 sec 256 KBytes 2.10 Mbits/sec 0 59.4 KBytes
[ 5] 7.00-8.00 sec 256 KBytes 2.10 Mbits/sec 2 46.7 KBytes
[ 5] 8.00-9.00 sec 256 KBytes 2.10 Mbits/sec 0 58.0 KBytes
[ 5] 9.00-10.00 sec 256 KBytes 2.10 Mbits/sec 0 60.8 KBytes
[ 5] 10.00-11.00 sec 384 KBytes 3.15 Mbits/sec 0 60.8 KBytes
[ 5] 11.00-12.00 sec 256 KBytes 2.10 Mbits/sec 0 60.8 KBytes
[ 5] 12.00-13.00 sec 384 KBytes 3.15 Mbits/sec 0 66.5 KBytes
[ 5] 13.00-14.00 sec 256 KBytes 2.10 Mbits/sec 1 50.9 KBytes
[ 5] 14.00-15.00 sec 384 KBytes 3.15 Mbits/sec 0 66.5 KBytes
[ 5] 15.00-16.00 sec 384 KBytes 3.15 Mbits/sec 0 73.5 KBytes
[ 5] 16.00-17.00 sec 384 KBytes 3.15 Mbits/sec 1 63.6 KBytes
[ 5] 17.00-18.00 sec 384 KBytes 3.15 Mbits/sec 0 72.1 KBytes
[ 5] 18.00-19.00 sec 512 KBytes 4.19 Mbits/sec 0 73.5 KBytes
[ 5] 19.00-20.00 sec 384 KBytes 3.15 Mbits/sec 1 63.6 KBytes
[ 5] 20.00-21.00 sec 384 KBytes 3.15 Mbits/sec 0 72.1 KBytes
[ 5] 21.00-22.00 sec 512 KBytes 4.19 Mbits/sec 0 73.5 KBytes
[ 5] 22.00-23.00 sec 384 KBytes 3.15 Mbits/sec 0 73.5 KBytes
[ 5] 23.00-24.00 sec 512 KBytes 4.19 Mbits/sec 0 74.9 KBytes
[ 5] 24.00-25.00 sec 384 KBytes 3.15 Mbits/sec 1 56.6 KBytes
[ 5] 25.00-26.00 sec 384 KBytes 3.15 Mbits/sec 0 70.7 KBytes
[ 5] 26.00-27.00 sec 512 KBytes 4.19 Mbits/sec 0 77.8 KBytes
[ 5] 27.00-28.00 sec 512 KBytes 4.19 Mbits/sec 0 77.8 KBytes
[ 5] 28.00-29.00 sec 384 KBytes 3.15 Mbits/sec 0 77.8 KBytes
[ 5] 29.00-30.00 sec 512 KBytes 4.19 Mbits/sec 0 80.6 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-30.00 sec 11.4 MBytes 3.19 Mbits/sec 9 sender
[ 5] 0.00-30.15 sec 11.1 MBytes 3.08 Mbits/sec receiver
iperf Done.
Expected behavior
I am expecting a small drop in the speed and more stability in response.
Your wstunnel setup
jefcolbi@jefcolbi-AcerLinLab:~/Softwares/Wstunnel$ ./start_wstunnel_tcp_iperf_direct.sh
2026-05-02T17:11:05.838784Z DEBUG rustls::webpki::anchors: add_parsable_certificates processed 148 valid and 0 invalid certs
2026-05-02T17:11:05.838812Z DEBUG rustls_platform_verifier::verification::others: Loaded 148 CA root certificates from the system
2026-05-02T17:11:05.839017Z INFO wstunnel: Starting wstunnel client v10.5.3
2026-05-02T17:11:05.839049Z INFO wstunnel::protocols::tcp::server: Starting TCP server listening cnx on 127.0.0.1:5201
2026-05-02T17:11:09.183222Z INFO wstunnel::protocols::tcp::server: Opening TCP connection to x.x.x:54611
2026-05-02T17:11:09.183341Z DEBUG wstunnel::protocols::tcp::server: Connecting to x.x.x:54611
2026-05-02T17:11:09.414268Z DEBUG wstunnel::protocols::tcp::server: Connected to tcp endpoint x.x.x:54611, aborted all other connection attempts
2026-05-02T17:11:09.414804Z DEBUG tunnel{id="019de9ac-307e-7fa0-9d4f-2adaa371a5c3" remote="127.0.0.1:5201"}: wstunnel::tunnel::transport::websocket: with HTTP upgrade request Request { method: GET, uri: /specialpath/events, version: HTTP/1.1, headers: {"host": "x.x.x:54611", "upgrade": "websocket", "connection": "upgrade", "sec-websocket-key": "THzHIKWLxitFk9rR7okLeA==", "sec-websocket-version": "13", "sec-websocket-protocol": "v1, authorization.bearer.eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6IjAxOWRlOWFjLTMwN2UtN2ZhMC05ZDRmLTJhZGFhMzcxYTVjMyIsInAiOnsiVGNwIjp7InByb3h5X3Byb3RvY29sIjpmYWxzZX19LCJyIjoiMTI3LjAuMC4xIiwicnAiOjUyMDF9.KXdGKlcnkN-1KT0qg7gQrVol7ybHCJTNlwqDbK_MBbI"}, body: Empty }
2026-05-02T17:11:09.612681Z DEBUG tunnel{id="019de9ac-307e-7fa0-9d4f-2adaa371a5c3" remote="127.0.0.1:5201"}: wstunnel::tunnel::client::client: Server response: Parts { status: 101, version: HTTP/1.1, headers: {"connection": "upgrade", "upgrade": "websocket", "sec-websocket-accept": "FVidRKah5Y0Db/Wo3+k6KmZ31yg=", "sec-websocket-protocol": "v1", "date": "Sat, 02 May 2026 17:11:09 GMT"} }
2026-05-02T17:13:39.106473Z DEBUG wstunnel::protocols::tcp::server: Connecting to 127.0.0.1:5201
2026-05-02T17:13:39.106758Z DEBUG cnx{peer="y.y.y.y:33310"}:tunnel{id="019de9ae-7900-7212-b14a-0d9c983b4c81" remote="127.0.0.1:5201"}: wstunnel::protocols::tcp::server: Connected to tcp endpoint 127.0.0.1:5201, aborted all other connection attempts
2026-05-02T17:13:39.106804Z INFO cnx{peer="y.y.y.y:33310"}:tunnel{id="019de9ae-7900-7212-b14a-0d9c983b4c81" remote="127.0.0.1:5201"}: wstunnel::tunnel::server::server: connected to Tcp { proxy_protocol: false } 127.0.0.1:5201
2026-05-02T17:13:39.816370Z INFO cnx{peer="y.y.y.y:61612"}: wstunnel::tunnel::server::server: Accepting connection
2026-05-02T17:13:39.832466Z INFO cnx{peer="y.y.y.y:61612"}:tunnel{id="019de9ae-7c01-7130-92e3-c300925ddb31" remote="127.0.0.1:5201"}: wstunnel::tunnel::server::server: Tunnel accepted due to matched restriction: Allow path prefix specialpath
Desktop (please complete the following information):
Additional context
I want to precise that when using xray core from project x, i am able to achieve 2MB/s with the same path on 4G.
wstunnel even with socks5 proxy is stuck to 300KB/s at best.
Describe the bug
I am trying run a complex path setup.
wireguard client -> wstunnel client -> nginx reverse proxy no buffering tls termination -> envoy proxy no buffering -> wstunnel server -> wireguard server
i observed so bad performance than the expected one.
i am testing with starlink and 4G networks.
On startlink there is 1/3 lost of speed ratio. for 4G the download speed is around 128KB/s and upload speed 3MB/s :) very weird
so i decided to test the wstunnel with iperf3.
To Reproduce
Steps to reproduce the behavior:
on server i run
iperf3 -s -p 5201wstunnel server ws:0.0.0.0:54611 --restrict-http-upgrade-path-prefix *******on client
wstunnel client \ -L "tcp://5201:127.0.0.1:5201" \ --http-upgrade-path-prefix ****** \ ws://x.x.x.x:54611iperf3 -c 127.0.0.1 -p 5201 -t 30 -b 50MResults on Starlink only
Expected behavior
I am expecting a small drop in the speed and more stability in response.
Your wstunnel setup
Desktop (please complete the following information):
Additional context
I want to precise that when using xray core from project x, i am able to achieve 2MB/s with the same path on 4G.
wstunnel even with socks5 proxy is stuck to 300KB/s at best.