// glossary

WebSocket

aka: ws:// · wss://

A WebSocket is a bidirectional persistent connection between browser and server, established by upgrading an HTTP request.

WebSockets are full-duplex: client and server can both send messages anytime. They start as a normal HTTP request with Connection: Upgrade and Upgrade: websocket headers; the server responds 101 Switching Protocols and the underlying TCP connection becomes a raw WebSocket frame stream.

Use cases that need the bidirectional channel: chat apps, collaborative editing (cursors, simultaneous typing), game state sync, realtime dashboards where the client also publishes (typing indicators, presence). One-way push? Use Server-Sent Events instead — simpler.

Reverse-tunnel services that proxy WebSockets correctly are a smaller set than you'd think. Some buffer or terminate Upgrade frames. lrok forwards WebSocket frames byte-for-byte through yamux streams, which is why HMR (which uses WebSockets) works through lrok.

Read more

// shipping?

lrok gives your localhost a public HTTPS URL with a reserved subdomain on the free plan. Useful when this term comes up in a real integration:

$ curl -fsSL https://lrok.io/install.sh | sh
$ lrok http 3000

← all glossary terms