Documentation
¶
Overview ¶
Command wsecho is a runnable demo of nexus.AsWS: one WebSocket path (/events) with two typed message handlers (chat.send + chat.typing) sharing one connection pool. Open http://localhost:8080/__nexus/ to see the endpoint card, or dial /events with any WebSocket client:
websocat 'ws://localhost:8080/events?userId=alice'
> {"type":"chat.send","data":{"text":"hello"}}
Every connection receives the echo — broadcast is automatic via sess.Emit.
Click to show internal directories.
Click to hide internal directories.