frp/pkg/util/net
Shani Pathak ba7adcab8f
fix(websocket): send tunnel payload as binary frames (#5363)
The ws/wss transport carries a raw byte stream (yamux), but the
golang.org/x/net/websocket Conn defaults to text frames (PayloadType
TextFrame). Per RFC 6455 §5.6 a text frame must contain valid UTF-8, so
RFC-compliant intermediaries (API gateways / reverse proxies) validate
the payload and close the connection when the binary tunnel data is not
valid UTF-8.

This goes unnoticed peer-to-peer because x/net/websocket does not
validate UTF-8 on read, but it breaks the connection through a compliant
validating proxy. Set PayloadType to BinaryFrame on both the server
listener and the client dialer so the tunnel is framed as binary.
2026-06-22 23:34:02 +08:00
..
conn.go protocol: add AEAD encryption negotiation to v2 wire control channel (#5304) 2026-05-06 10:43:47 +08:00
conn_test.go protocol: add AEAD encryption negotiation to v2 wire control channel (#5304) 2026-05-06 10:43:47 +08:00
dial.go fix(websocket): send tunnel payload as binary frames (#5363) 2026-06-22 23:34:02 +08:00
dns.go set CompatibilityMode for android (#4091) 2024-03-21 17:34:09 +08:00
http.go cleanup code (#4019) 2024-02-22 21:04:21 +08:00
kcp.go update kcp-go package (#4009) 2024-02-20 16:11:37 +08:00
listener.go optimize some code (#3801) 2023-11-27 15:47:49 +08:00
proxyprotocol.go add proxy protocol support for UDP proxies (#4810) 2025-06-25 11:40:23 +08:00
proxyprotocol_test.go add proxy protocol support for UDP proxies (#4810) 2025-06-25 11:40:23 +08:00
tls.go format import package name (#3455) 2023-05-29 14:10:34 +08:00
udp.go refactor: fix modernize lint issues (#5215) 2026-03-07 23:10:19 +08:00
websocket.go fix(websocket): send tunnel payload as binary frames (#5363) 2026-06-22 23:34:02 +08:00