examples/

directory
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT

Directories

Path Synopsis
Command broadcast runs a chat-style hub: every message a client sends is relayed to all connected clients.
Command broadcast runs a chat-style hub: every message a client sends is relayed to all connected clients.
Command client talks to an echo server.
Command client talks to an echo server.
Command client-events is the chat client as an events.Handler: Dial runs the handler until the connection ends and returns the error OnClose saw.
Command client-events is the chat client as an events.Handler: Dial runs the handler until the connection ends and returns the error OnClose saw.
Command echo serves a WebSocket echo endpoint, the shape the Autobahn test suite expects: go run ./examples/echo, then point wstest at ws://host:9001.
Command echo serves a WebSocket echo endpoint, the shape the Autobahn test suite expects: go run ./examples/echo, then point wstest at ws://host:9001.
Command echo-events is the echo server as an events.Handler, the shape a gws handler takes: one method per event and no read loop of your own.
Command echo-events is the echo server as an events.Handler, the shape a gws handler takes: one method per event and no read loop of your own.
Command echo-http serves the echo endpoint from an http.Handler, for servers that already run on net/http: routes, middleware, or TLS through ListenAndServeTLS.
Command echo-http serves the echo endpoint from an http.Handler, for servers that already run on net/http: routes, middleware, or TLS through ListenAndServeTLS.
Command echo-queue echoes through a Queue.
Command echo-queue echoes through a Queue.
Command echo-stream echoes messages of any size in bounded memory.
Command echo-stream echoes messages of any size in bounded memory.
Command tunnel carries TCP connections over WebSockets, the way a WebSocket-only ingress or a browser-side proxy needs: NetConn turns a connection into a net.Conn, one message per Write, and io.Copy does the rest.
Command tunnel carries TCP connections over WebSockets, the way a WebSocket-only ingress or a browser-side proxy needs: NetConn turns a connection into a net.Conn, one message per Write, and io.Copy does the rest.

Jump to

Keyboard shortcuts

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