gopherjs / websocket

websocket provides high- and low-level bindings for the browser's WebSocket API.
BSD 3-Clause "New" or "Revised" License
111 stars 25 forks source link

Add support for WebSocket sub-protocols #24

Closed htdvisser closed 4 years ago

htdvisser commented 6 years ago

This Pull Request adds support for the optional protocols parameter to the WebSocket constructor. Both the "protocol string" and "array of protocol strings" variants are supported, depending on the number of protocols passed to websocket.Dial or websocketjs.New.