vbmithr / ocaml-websocket

Websocket library for OCaml
ISC License
161 stars 44 forks source link

How do I respend to client with subprotocol (Sec-WebSocket-Protocol). #98

Closed kkazuo closed 6 years ago

kkazuo commented 6 years ago

Websocket_async.client can send extra_headers, but server can not respond with subprotocol.

https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers

The client may close the connection if it doesn't get the subprotocol it wants.

I'm hit this issue and I'd like to respond to client with subprotocol header.

Thanks

vbmithr commented 6 years ago

Thanks for fixing :)