Skip to main content

ws_bind_host

Function ws_bind_host 

Source
pub fn ws_bind_host() -> String
Expand description

Bind a WebSocket server. Blocks; returns Unit on shutdown (the process is normally killed before that). The interface the net.serve_ws* family binds to (#719).

All four WS servers bound 127.0.0.1 unconditionally, so a containerised deployment could not accept cross-container connections at all — ev-fleet’s lex-csms was running a socat sidecar to republish the loopback listener on the container interface.

LEX_WS_HOST is the same escape hatch the legacy HTTP path already uses for its own options (ServeOpts::from_env, alongside LEX_NET_INLINE_VM and LEX_NET_HTTP2): it fixes an existing deployment without touching the program or its signatures.

The default stays 127.0.0.1. Widening what an existing program listens on, on upgrade and without anybody asking, is not a bug fix — a server that was only ever reachable from localhost must not silently become reachable from the network.