Registry / networking / gobwas-ws

gobwas-ws

JSON →
library1.4.0gogounverified

Package ws implements a client and server for the WebSocket protocol as specified in RFC 6455.

go get github.com/gobwas/ws
INSTALL
IMPORT
SIG · GOBWAS-WS
G
gobwas-ws
networkinggov1.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ws
github.com/gobwas/ws

Upgrades an HTTP connection to WebSocket and reads a message.

package main import ( "log" "net/http" "github.com/gobwas/ws" "github.com/gobwas/ws/wsutil" ) func main() { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { conn, _, _, err := ws.UpgradeHTTP(r, w) if err != nil { log.Fatal(err) } defer conn.Close() msg, op, err := wsutil.ReadClientData(conn) if err != nil { log.Fatal(err) } log.Printf("Received: %s (opcode %d)", msg, op) }) log.Fatal(http.ListenAndServe(":8080", nil)) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.4.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
gobwas-ws — go get gobwas-ws · libregistry