Description
there are 5 websock libraries
http://stackoverflow.com/questions/16392260/which-websocket-library-to-use-with-node-js
If you have event base sockets and handling already, websocket itself isn't a lot to implement
https://github.com/d3x0r/SACK/blob/master/src/netlib/html5.websocket/client/html5.websocket.client.c
https://github.com/d3x0r/SACK/blob/master/src/netlib/html5.websocket/server/html5.websocket.c
https://github.com/d3x0r/SACK/blob/master/src/netlib/html5.websocket/html5.websocket.common.c
(some structures defined in .h files nearby)
Maybe that one can get a websock object from the HTTP?
Or maybe I'm msising something and the HTTP connection has a mode it goes into to support length-data transmissions bi-directionally?
That's all websock is once it negotiates is a UTF-8 -esqe encoding of lengths... most implementations didn't go over 16k fragments.
Activity
mscdex commentedon Feb 28, 2016
I'm not sure I understand what exactly you're asking for. Are you asking for websockets in core or something else?
d3x0r commentedon Feb 28, 2016
Basically; and supplying a reference that addressed all 3 versions... it's much less complex if you don't have to handle the HTTP stuff. (which that does too)
if I have an HTTP socket request on the server I'd like to define like on( "upgrade", (protocol)=>{ is protocol == ;'websocket' ) or something and then be able to or already have on( "message" )
On the other side that made the request, they can keep the HTTP object open and do a http.upgrade( 'websocket' ) and define the appropriate websock methods on that object? Or maybe return a separate websocket object from that.... which can then have message/close/error handlers.
I don't know if the methods get overwritten between HTTP and websock (MDN, Opera, IE, Chrome) all supported it, so I sort of expect it in a core library; it's not a horibble standard, it's masked but only by option, and if it were a semi-native implmeentation with HTTP it might have an easier time dealing with the bytecode length and fragments and other bits ...
mscdex commentedon Feb 28, 2016
In that case, this has been discussed before. See #1010 for example.
d3x0r commentedon Feb 28, 2016
closed as duplicate