Giter Club home page Giter Club logo

Comments (4)

vbmithr avatar vbmithr commented on June 24, 2024

On 27/06/2013 17:01, olleharstedt wrote:

Hello

I'm using your library for my card playing webpage (thanks for that)!
Now I try to switch to SSL, but the websocket will no longer connect
(I've also switched from "ws://..." to "wss://..."). This is the error I
receive:

Lwt_stream.Empty[Thu Jun 27 12:44:44 2013] [OcamlNet]
/cgi-bin/drakskatten_ajax: Netchannels.Closed_channel (Status 500),
referer: https://127.0.1.2/cgi-bin/drakskatten

I'm using the cgi app as a small websocket server, where each instance
listens on a unique port, starting from 8080.

Do you know what's going on? Is it apache? Or should I use the Lwt_ssl
socket type instead of the regular?

Loading webpages from the cgi works properly, even with SSL. Websocket
works without SSL, but not with.

Grateful for your help
Olle

I’m going to have a look tomorrow.
Thanks for your interest in the library :)

Vincent

from lwt-websocket.

vbmithr avatar vbmithr commented on June 24, 2024

Oh, I thought it was MY websocket library. Sorry :)

from lwt-websocket.

olleharstedt avatar olleharstedt commented on June 24, 2024

Ah, no, not ocaml-websocket, but lwt-websocket. :)

Do you know how to use websockets with SSL? Just switching to "wss://..." doesn't seem enough. This is the setup code I use. Should I use another socket type to get it to work with SSL?

   let start_websocket env = 
     let addr_inet = Unix.ADDR_INET (Unix.inet_addr_of_string env#addr, env#port) in 
     let sock_listen = Lwt_unix.socket Unix.PF_INET Unix.SOCK_STREAM 0 in 

     (** setup listen socket *) 
     Lwt_unix.setsockopt sock_listen Unix.SO_REUSEADDR true; 
     Lwt_unix.bind sock_listen addr_inet; 
     Lwt_unix.listen sock_listen 5; 
     ...

Apache2 takes care of the SSL, so I'm at bit of a lost, here.

from lwt-websocket.

vbmithr avatar vbmithr commented on June 24, 2024

On 28/06/2013 15:34, olleharstedt wrote:

It is yours. Not sure where the fault is, though. Do you know how to use websockets with SSL? Just switching to"wss://..." doesn't seem enough.

Ok, you're talking about my fork of this library then. I wrote another
websocket library completely from scratch (ocaml-websocket) that I hope
is working over SSL (not even sure…). I never used this library
actually, I might have a look in some time but I'm currently too busy.

Good luck,

Vincent

from lwt-websocket.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.