wsecho

command
v0.22.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2026 License: MIT Imports: 1 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL