1 //go:build !js 2 // +build !js 3 4 // Package websocket implements the RFC 6455 WebSocket protocol. 5 // 6 // https://tools.ietf.org/html/rfc6455 7 // 8 // Use Dial to dial a WebSocket server. 9 // 10 // Use Accept to accept a WebSocket client. 11 // 12 // Conn represents the resulting WebSocket connection. 13 // 14 // The examples are the best way to understand how to correctly use the library. 15 // 16 // The wsjson subpackage contain helpers for JSON and protobuf messages. 17 // 18 // More documentation at https://nhooyr.io/websocket. 19 // 20 // # Wasm 21 // 22 // The client side supports compiling to Wasm. 23 // It wraps the WebSocket browser API. 24 // 25 // See https://developer.mozilla.org/en-US/docs/Web/API/WebSocket 26 // 27 // Some important caveats to be aware of: 28 // 29 // - Accept always errors out 30 // - Conn.Ping is no-op 31 // - Conn.CloseNow is Close(StatusGoingAway, "") 32 // - HTTPClient, HTTPHeader and CompressionMode in DialOptions are no-op 33 // - *http.Response from Dial is &http.Response{} with a 101 status code on success 34 package websocket // import "nhooyr.io/websocket" 35