Closed hongchangwu closed 5 years ago
I started working on a fix but I got diverted by other things. I'll try to finish it. Thanks for the report.
This should be fixed in master
, please check the upgrade_connection
sample program.
Thanks! I'll give it a try.
The new API seems to work well.
Thanks.
e.g. if you do something like it doesn't really work:
I think this is because
upgrade_connection
reads directly from the TCP sockets and bypasses the TLS layer of the cohttp server.My workaround is to use the new expert mode of
cohttp-lwt
introduced in https://github.com/mirage/ocaml-cohttp/pull/647 which exposes input and output channels in the callback. But it does mean I have to duplicate a fair amount of logic fromupgrade_connection
. Is it possible to adaptupgrade_connection
to work with the new expert mode of cohttp?