websocketserver

command
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Command websocketserver shows a WebSocket endpoint living alongside ordinary HTTP routes on one port, under both compilers.

tinygo build -o wsserver ./examples/websocketserver
./wsserver
# open http://127.0.0.1:8080/ in a browser, or:
# curl http://127.0.0.1:8080/healthz

go run ./examples/websocketserver works too. The only line that differs from an ordinary net/http program is the httpserver.Serve call, and under standard Go that call is http.Server.Serve.

Jump to

Keyboard shortcuts

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