Data plane strips hop-by-hop headers; WebSocket upgrades cannot pass through an ALB listener
Summary
The ELBv2 data plane (services/elbv2/ElbV2DataPlane.java, introduced with #677) treats Connection and Upgrade as hop-by-hop headers and removes them before proxying requests to targets. Regular HTTP requests work fine, but a WebSocket upgrade needs those two headers to reach the target, so any websocket application behind a simulated ALB cannot establish its socket. A real ALB tunnels upgrades transparently, so this is a fidelity gap.
Repro steps
- Start floci, create an ALB with an HTTP listener pointing at a target that prints the headers it receives (any echo service works).
- Send an upgrade request through the listener:
curl -i -H "Connection: Upgrade" -H "Upgrade: websocket" \
-H "Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==" \
-H "Sec-WebSocket-Version: 13" http://localhost:4566/...- Look at what the target received.
Expected: the target gets the full upgrade (Upgrade, Connection: Upgrade, and the Sec-WebSocket-* headers) and can complete a 101 handshake. Ideally the upgraded connection tunnels bidirectionally afterwards, like a real ALB does.
Actual: Connection and Upgrade are gone when the request reaches the target. The target's websocket handshake fails. For example, a Rust hyper/axum server reports: Connection header did not include 'upgrade'.
Cause
The proxy path's hop-by-hop filter:
HOP_BY_HOP_HEADERS = List.of(
"connection", "keep-alive", "transfer-encoding", "upgrade",
...
);The Upgrade / Connection: Upgrade pair is hop-by-hop in general, but when the request is an upgrade that pair must be preserved, not dropped (mirror of how the API Gateway v2 data plane tunnels them, since #712 added real websocket support there).
Environment
- floci nightly, digest
sha256:3f73224f...(September 2026). The currentmainhas the same behavior. - ELBv2 HTTP listener,
iptargets (Fargate shape).
Workaround we ship today
A raw TCP relay that bypasses the simulated listener for websocket terminals; HTTP stays behind the simulated ALB.
Suggested fix
In the proxy path, treat upgrade requests as tunnels: do not strip Upgrade/Connection from a request carrying Connection: Upgrade, forward the 101 switch and the frames both ways. Plain requests keep the current filtering.
Source: floci-io/floci