Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for Native Websocket which is supported on HTTP socket #5467

Closed
d3x0r opened this issue Feb 28, 2016 · 4 comments
Closed

Request for Native Websocket which is supported on HTTP socket #5467

d3x0r opened this issue Feb 28, 2016 · 4 comments
Labels
feature request Issues that request new features to be added to Node.js. http Issues or PRs related to the http subsystem.

Comments

@d3x0r
Copy link
Contributor

d3x0r commented Feb 28, 2016

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.

@Trott Trott added feature request Issues that request new features to be added to Node.js. http Issues or PRs related to the http subsystem. labels Feb 28, 2016
@mscdex
Copy link
Contributor

mscdex commented 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
Copy link
Contributor Author

d3x0r commented 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
Copy link
Contributor

mscdex commented Feb 28, 2016

In that case, this has been discussed before. See #1010 for example.

@d3x0r
Copy link
Contributor Author

d3x0r commented Feb 28, 2016

closed as duplicate

@d3x0r d3x0r closed this as completed Feb 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js. http Issues or PRs related to the http subsystem.
Projects
None yet
Development

No branches or pull requests

3 participants