rpxy-l4 on 443 drops connections whose first bytes take longer than 100 ms (hard-coded probe timeout)
Version: panel 14.0.2, rpxy-l4 0.2.3 (binary installed by services/rust-rpxy-l4/install.sh)
Problem
rpxy-l4 listens on port 443 and waits only 100 ms for the first bytes of a TCP connection while it detects the protocol. If the client's first bytes arrive later, the connection is closed and logged as Timeout (100ms) while probing TCP stream from ....
This affects any client or hop with a round-trip time near or above 100 ms. In my case, users reach the server through a TCP tunnel (Iran to Germany), where the first bytes of each stream arrive late: connections that send their first bytes 400 ms after connecting were dropped, so port 443 was unreliable through the tunnel. My log had thousands of these timeouts.
The limit is a hard-coded constant in rpxy-l4 (TCP_PROTOCOL_DETECTION_TIMEOUT_MSEC) and there is no config key to change it. It is also reported upstream: junkurihara/rust-rpxy-l4#203.
What I did
- Added a setting
tcp_protocol_detection_timeout_msec(default stays 100 ms) torpxy-l4: junkurihara/rust-rpxy-l4#286. - Built
rpxy-l4with it, and addedtcp_protocol_detection_timeout_msec = 5000toproxy_templates/rust-rpxy-l4/server/base.j2. - Verified: connections that send their first bytes after 0.4 s and 1.5 s are now accepted, both locally and through the tunnels. Before, a small haproxy "wait for first bytes" shim in front of 443 was needed.
Suggestion
Once rpxy-l4 releases the setting, bump the packaged version in install.sh and set a longer value in the template (a few seconds is plenty, like sslh's default of 5 s). Until then, the 100 ms limit makes 443 behind rpxy-l4 unreliable for high-latency clients.
Not related to #5576 (a crash of HAProxy via rpxy-l4 UDP/443).
Confirmed on another production installation: Hiddify panel 14.0.5, Ubuntu 22.04.5 LTS, x86_64.
The installed services/rust-rpxy-l4/install.sh requests package 0.2.4, while the bundled executable reports rpxy-l4 0.2.3. Its logs contain Timeout (100ms) while probing TCP stream. During the reported stalls, the relevant services remained running; the resource snapshots did not show OOM, file-descriptor exhaustion, or conntrack exhaustion.
Reproduction and verification
I tested the installed binary and the official upstream 0.2.5 release in a separate network namespace on the same machine, without changing the production listeners:
- The bundled binary and 0.2.5 with its default timeout both drop an HTTP request sent 300 ms after TCP connect.
- With
tcp_protocol_detection_timeout_msec = 3000, requests delayed by 150 ms, 300 ms, 1 s, and 2.5 s succeed. - A 3.3 s delay is still rejected with the 3 s setting, confirming that the configured limit is actually enforced.
- TLS SNI routing, outbound PROXY protocol v2, basic UDP forwarding, and runtime timeout reload also pass. The production configuration's default and specific TLS routes were checked in isolation as well.
Applied workaround
I have now deployed the checksum-verified official 0.2.5 release and added this global setting through Hiddify's server base-config override:
tcp_protocol_detection_timeout_msec = 3000
Only the rust-rpxy-l4 configuration was regenerated using Hiddify's generator, and only hiddify-rpxy-l4 was restarted. The panel and the other proxy processes were left running; files under generated/ were not edited manually.
On the live listener, deliberately delaying the first TLS bytes by 300 ms and 2.5 s now succeeds end to end through VLESS over WebSocket, both directly and through a separate VPN route. Normal HTTPS page and 64 KiB download checks through the saved Hiddify client outbound also pass.
This confirms the short protocol-detection timeout defect and the workaround. It does not establish that every previously observed VPN or panel stall had the same cause.
Could Hiddify bump the packaged rpxy-l4 version and set a longer detection timeout in the server template? Upstream now supports the option, but the default is still 100 ms, so updating the executable alone does not resolve this case.
Longer live follow-up
The short-timeout fix is confirmed, but the original availability problem is not fully resolved. During a 6-minute paired VLESS/WS check, the direct path passed 19/37 requests, while a separate VPN route to the same endpoint passed 37/37. The old 100 ms probe-timeout messages did not recur after the change.
A bounded capture of TCP header metadata on the VPS shows failed direct attempts where client SYNs arrive, the VPS retransmits SYN-ACKs, and no final client ACK arrives. Other affected flows show retransmitted server data. These failures can occur before protocol detection, so I am treating the remaining network-path problem separately rather than claiming the timeout change fixes every stall.
@hiddify-com need attention: rpxy-l4 on 443 drops any connection whose first bytes take more than 100 ms, which causes stalls on slow mobile networks (confirmed on 14.0.5). The fix (tcp_protocol_detection_timeout_msec + rpxy-l4 0.2.5) is only in dev, so it needs to ship in a stable release.
Fixed on dev: rpxy-l4 is updated to 0.2.5 (61d000c), which makes the TCP protocol detection timeout configurable instead of the hard-coded 100 ms. It will be in the next release.