{"repo":"gobwas/ws","free":true,"listed":false,"github":"https://github.com/gobwas/ws","clone":"git clone https://github.com/gobwas/ws.git","description":"A tiny WebSocket library for Go.","language":"Go","stars":6462,"topics":["go","websocket","rfc-6455","golang","fast"],"license":"MIT","category":"networking-infra","readme_excerpt":"ws [![GoDoc][godoc-image]][godoc-url] [![CI][ci-badge]][ci-url] [RFC6455][rfc-url] WebSocket implementation in Go. Features - Zero-copy upgrade - No intermediate allocations during I/O - Low-level API which allows to build your own logic of packet handling and buffers reuse - High-level wrappers and helpers around API in wsutil package, which allow to start fast without digging the protocol internals Documentation [GoDoc][godoc-url]. Why Existing WebSocket implementations do not allow users to reuse I/O buffers between connections in clear way. This library aims to export efficient low-level interface for working with the protocol without forcing only one way it could be used. By the way, if you want get the higher-level tools, you can use wsutil package. Status Library is tagged as v1 so its API must not be broken during some improvements or refactoring. This implementation of RFC6455 passes Autobahn Test Suite and currently has about 78% coverage. Examples Example applications using ws are developed in separate repository ws-examples. Usage The higher-level example of WebSocket echo server: Lower-level, but still high-level example: We can apply the same pattern to read and write structured responses through a JSON encoder and decoder.: The lower-level example without wsutil : Zero-copy upgrade Zero-copy upgrade helps to avoid unnecessary allocations and copying while handling HTTP Upgrade request. Processing of all non-websocket headers is made in place with use of registe","default_branch":null,"files":null,"tree":[],"storefront":"/r/gobwas","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/gobwas/ws/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}