Open
Description
May be pass frames_out_fn
into incoming_handler
?
https://github.com/vbmithr/ocaml-websocket/blob/master/lwt/websocket_cohttp_lwt.ml#L40
Without frames_out_fn
its hard to use incoming_handler
to react to messages. You have to do something like
let out_fn = ref (fun _ -> ()) in
let on_message frame =
(* TODO: parse frame *)
!out_fn @@ Some (Frame.create ~opcode:Close ())
in
let%lwt resp, fr_out_fn = Websocket_cohttp_lwt.upgrade_connection req on_message in
out_fn := fr_out_fn
Or may be it should be done other way?
Metadata
Metadata
Assignees
Labels
No labels