Type-safe messaging - define your events as TypeScript types, get full type checking on both sending and receiving
Built-in authentication - every client goes through an auth flow before exchanging messages. You can validate tokens, check credentials, or simply accept everyone - it's up to your callback
Reply tracking - send a message and register a callback for when the client replies to that specific message, enabling request-response patterns over WebSocket
Flexible server modes - run standalone, attach to an existing HTTP server (Express, Fastify, etc.), or handle WebSocket upgrades manually
Broadcasting - send a message to all connected clients with a single call
Data flexibility - send plain text or binary data. Mix them together. Exchange any data type, including undefined, bigint, Date or your own instances
Client features
tbd
Installation
npminstall@ezez/ws-server
You also need @ezez/ws-client on the client side. The two libraries use a shared binary protocol and must be used
together.