Open darioteixeira opened 8 years ago
On 02/02/2016 02:26, Dario Teixeira wrote:
Since |ocaml-websocket| uses |ocaml-conduit|, in theory it should support secure (HTTPS) websockets out-of-the-box In practice, however, I've been unable to get even simple examples to run (see this message https://sympainriafr/sympa/arc/caml-list/2016-01/msg00037html) I think a lot of headaches could be spared if such a simple example were shipped with the library (a secure version of the |wscat| example, for instance)
Hey Dario,
I'll have a look. Sorry that it caused you headaches :)
Hey @vbmithr, did you manage to find out the problem with https?
I'm using the Async client and have no problem with https. To be honest that's the only thing I need and use. I'll have a look at your message (server issue with TLS right?) today.
The scenario I'm having trouble with consists of an Ocsigen server (running in HTTPS) whose daemon uses OCaml-websocket to listen to HTTPS websockets (using LWT, of course). The clients are regular web browsers. Obviously I don't discount the possibility that I'm doing something dumb somewhere, which is why having an example using secure websockets would be helpful...
Are you using @lostman 's upgrade connection feature?
@lostman : I believe your use case was pretty similar to @darioteixeira 's one. Did you try https connections/ have any issue with them?
@vbmithr: No. Should I?
Btw, I've tried the current master, and it seems to work now (hurrah!). There is however an exception being raised when the client (the browser) disconnects: Uncommon.Boot.Unseeded_generator
. Harmless?
Thank you very much!
On 11/04/2016 22:15, Dario Teixeira wrote:
Btw, I've tried the current master https://github.com/vbmithr/ocaml-websocket/commit/293a4b47f3d0181e4bda733047550275d15dff4c, and it seems to work now (hurrah!). There is however an exception being raised when the client (the browser) disconnects: |Uncommon.Boot.Unseeded_generator|. Harmless?
Thank you very much!
For the Unseeded_generator exception, you need to call Nocrypto_entropy_lwt.initialize before using websocket functions. I don't know why it works now though, and did not before…
I don't know why it works now though, and did not before…
I could try a git bisect to narrow down the commit which made it work. Have you managed to replicate the problem on your end?
Ok, I had a look, indeed I could not make the Lwt SSL server working, see #50. Did it really worked for you?
With the latest master it does work fine.
Would be nice to have
Since
ocaml-websocket
usesocaml-conduit
, in theory it should support secure (HTTPS) websockets out-of-the-box. In practice, however, I've been unable to get even simple examples to run (see this message). I think a lot of headaches could be spared if such a simple example were shipped with the library (a secure version of thewscat
example, for instance).