+ (* [ws_accept subprotocol_opt handler] -- websocket connection is accepted,
+ subprotocol will be sent to client.
+ - [None] for "client hadn't specified which subprotocols he can use"
+ or "no one of client's protocols is acceptable" (it's up to websocket
+ client to close connection when it proposed subprotocols but server
+ can't accept any of them).
+ - [Some p] for "server will use protocol [p]". Note: [p] must be
+ chosen from the list returned by [Amall_http.ws_protocols request],
+ otherwise the server will drop this connection with runtime error
+ (it will not count as "graceful websocket connection shutdown"!).
+ Take a look at RFC 6455, section 4.2.2, for the reasons of such
+ seemingly strange behaviour of server's [subprotocol] choice.
+ However, authentication, redirects, Origin checking are not implemented
+ option string -> (Websocket.Server(IO)(I)).handler unit ->
endpoint websocket_service_func ->
value it_post_vars = HS.it_post_vars
+ value ws_accept = HS.ws_accept
value default_http_fallback _segpath rq =
(* todo: escape chars for html *)