websocket is a minimal and idiomatic WebSocket library for Go. Minimal and idiomatic API. First class context.Context support. Fully passes the WebSocket autobahn-testsuite. Single dependency. JSON and protobuf helpers in the wsjson and wspb subpackages. Zero alloc reads and writes. Concurrent writes. Close handshake. net.Conn wrapper. Ping pong API. RFC 7692 permessage-deflate compression. Compile to Wasm. Transparent message buffer reuse with wsjson and wspb subpackages. Gorilla writes directly to a net.Conn and so duplicates features of net/http.Client. Gorilla requires registering a pong callback before sending a Ping. Compare godoc of nhooyr.io/websocket with gorilla/websocket side by side. Will enable easy HTTP/2 support in the future.

Features

  • Mature and widely used
  • Prepared writes
  • Configurable buffer sizes
  • Minimal and idiomatic API
  • Zero alloc reads and writes
  • Full context.Context support
  • Transparent message buffer reuse with wsjson and wspb subpackages

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow websocket for Go

websocket for Go Web Site

Other Useful Business Software
Gen AI apps are built with MongoDB Atlas Icon
Gen AI apps are built with MongoDB Atlas

The database for AI-powered applications.

MongoDB Atlas is the developer-friendly database used to build, scale, and run gen AI and LLM-powered apps—without needing a separate vector database. Atlas offers built-in vector search, global availability across 115+ regions, and flexible document modeling. Start building AI apps faster, all in one place.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of websocket for Go!

Additional Project Details

Operating Systems

Linux, Mac, Windows

Programming Language

Go

Related Categories

Go Libraries, Go WebSocket Libraries

Registered

2023-01-18