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.
Click to show internal directories.
Click to hide internal directories.