New to Google Cloud? Get $300 in free credit to explore Compute Engine, BigQuery, Cloud Run, Vertex AI, and 150+ other products.
Start your next project with $300 in free Google Cloud credit. Spin up VMs, run containers, query exabytes in BigQuery, or build AI apps with Vertex AI and Gemini. Once your credits are used, keep building with 20+ products with free monthly usage, including Compute Engine, Cloud Storage, GKE, and Cloud Run functions. Sign up to start building right away.
Start Free Trial
Cut Cloud Costs with Google Compute Engine
Save up to 91% with Spot VMs and get automatic sustained-use discounts. One free VM per month, plus $300 in credits.
Save on compute costs with Compute Engine. Reduce your batch jobs and workload bill 60-91% with Spot VMs. Compute Engine's committed use offers customers up to 70% savings through sustained use discounts. Plus, you get one free e2-micro VM monthly and $300 credit to start.
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. ...
...Library is tagged as v1* so its API must not be broken during some improvements or refactoring. Example applications using ws are developed in separate repository ws-examples. We can apply the same pattern to read and write structured responses through a JSON encoder and decoder.Zero-copy upgrade helps to avoid unnecessary allocations and copying while handling HTTP Upgrade request.