Closed o3o closed 2 years ago
Websockets and cgi don't mix very well by default because with websocket you want to take control of the connection, but with cgi, the connection is managed by the parent web server.
So the websocket server tries to take ownership of the connection and send non-http data, but the outer server has no idea and tries to close it despite you still using it, or intercepts the Upgrade header, or just plain thinks the datastream is corrupted.
I tried to make the cgi.d add-on server for websocket to work around this, but it always had some kind of conflict anyway and just wasn't reliable.
You might be able to configure your outer http server (apache or nginx or whatever) to allow it, but as far as I know cgi+websocket is unsupported by them.
But you're best off using one of the embedded httpd modes in cgi.d and using your outer server as a reverse proxy.
exhaustive as always ... Thank you very much for your support
I am testing your awesome cgi and websocket modules see here.
I need to use both cgi and websocket, but when I add in dub
my server example crashes. If I remove
subConfiguration
it works wellMy env.
Thank you.