Roadmap for v3
This list is open to suggestions!
- [ ] Improve the documentation
That is obviously the major pain point of the project.
- [x] Reverse the direction of the ping-pong mechanism
Currently the client emits a ping and waits for a pong from the server, relying on setTimeout() to check whether the connection is still alive or not. But there are reports of throttled timers on the browser side, which may trigger random disconnections.
A solution would be that the ping is emitted from the server to the client, but that is a breaking change which will also break other client implementations..
Related: https://github.com/socketio/socket.io/issues/5082
-
[x] Update the source code to ES6 in every project
-
[x] Migrate to webpack 4 (or another bundler, if need be)
-
[ ] Remove the sticky-session requirement when using multiple nodes
-
[ ] Default to websocket, and use XHR polling as fallback
Currently polling is established first, and then upgraded to websocket if possible.
- [x] Make the
generateIdmethod asynchronous
This one is also a breaking change. Related: https://github.com/socketio/engine.io/pull/535
-
[ ] Update the Typescript bindings, if need be
-
[ ] Triage issues
No release date for now, as I'm not sure how much time I will be able to dedicate to those points in the following weeks. But any help is welcome!
Looks like a great plan.
I'm switching from nodejs to golang, and found there is no socket.io 2 implementation. https://github.com/googollee/go-socket.io/issues/188
What do you think of golang server support for v3? I'll be happy to take part in this development.
@theromis are you talking about a golang client (which will connect to the Node.js server) or an actual golang server? (I think some work has been done here too: https://github.com/graarh/golang-socketio)
@darrachequesne Thank you for quick reply, yes I'm talking about server side golang-socketio. Project mentioned by you is almost dead (last commit more than a year). https://github.com/googollee/go-socket.io project looking for maintainer. And non of them support socket.io v2. I thought may be original greatest nodejs socketio developers could be interested in golang development too :)
Updated Java client would be nice too.
A socket.io package for server side swift like https://github.com/vapor would be very nice too since there is a swift client already.
Sounds like if server side socket.io will be written in some native language like C/C++ it can be used everywhere including nodejs, golang, java, rust and what so ever... What's wrong with this approach? My personal opinion socket.io is like de facto standard for modern world. Why not to make it ideal?
One thing that has always bothered me about socket.io which could be addressed in the next major release could be https://github.com/socketio/socket.io/issues/2124 and https://github.com/socketio/socket.io/issues/2343
There has been a historical inconsistency in the handling of namespaces and middlewares.
Also, the client emitting a reconnect event makes more sense in my opinion, after it connects to the namespace rather than it being just the Manager's reconnect event... For example, if there is some authenication error in a sub namespace middleware, the client will still get a reconnect event which I think is counter-intuitive.
From node version 10.5 there is a new Worker Threads, which is currently in experimental state, but when it released, I think it can be a better way for use socket.io instead of using redis server.
Pro:
- less dependency (redis)
- native support of multi threading
- more control
Con:
- only will work from that nodejs version what release the worker thread (10.x || 11). But this can be handled.
@Twois interesting! It would work for workers on the same host, but what about multiple hosts?
@perrin4869 good idea :+1:
I left a lot of ideas here: #3311 please read :) Will close that one and continue discussion here.
@MickL would you have some time to migrate the socket.io repository to Typescript, as an example?
I am afraid my knowledge of network technology and information security is limited. I rely on high level frameworks like Express or Socket.io.
As far as i see socket.io is already written OOP and documented well so it would be a no brainer to simply port it. My idea was to go as modular as possible so someone like me could contribute more easy and the client ist treeshakable. Also going more reactive could be an idea to make things simpler. Anyway im not enough into the code so both ideas could possibly make no sense in this project tho.
@darrachequesne its a good, question. I will thinking on it.
Require Nodejs 8 and above since earlier versions are at maintenance at best, see https://nodejs.org/en/about/releases/, at the very least nodejs 4 should be dropped(I noticed from .travis.yml that you support it)
Has 3.0 related work started in any branch/repo? Just checking if there's a place to stay informed on how it's going or contributing.
I would like to see improved support for error-handling on the server-side. This has been brought up in a few other issues, but more specifically, it would be great if:
- There were support for a custom error-handling middleware in addition to the default. This could look something like Express's (which can be appended as the last in the chain of
app.use(), similar tosocket.use(), middlewares): https://expressjs.com/en/guide/error-handling.html
The problem, at present, is that there's no way to add any kind of tracking or logging to an error once it has been nexted.
-
Additionally, since the 'error' namespace is blacklisted,
socket.emit('error', err)won't be heard by the client), I can'temitan error from somewhere on the server that doesn't have easy access tonext()(i.e. from inside ofsocket.on('event')). This makes it difficult to create a uniform error-handling solution. -
next(err)should dispatch anErrorobject rather than a string. I understand that there is a workaround for this (https://github.com/socketio/socket.io/issues/3371) by adding a magical.dataproperty to whatever object you callnext()on. This is not documented, however, and is unintuitive.
Generally speaking, next(err) seems like an unnecessary blackbox of very limited error-handling capacity.
Thanks for your hard work, and keeping at it!
@darrachequesne Any update on v3 being a reality? I haven't seen any progress on this since 2018.
A short update: my current contract was recently updated, and I should be able to dedicate one day per week (1/5th) to the project maintenance. Thus work on v3 should be resumed shortly.
Really keen to help out on this project in one way or another.
If there is a way to identify how I can do this let me know - I just don't want to potentially fix things for them to not be merged! So would rather wait for some guidance, if help is wanted. Cheers
- compression (gzip, zlib, defalte/inflate)
- rework mechanism of sending binary data (2 packets now... ws text and ws binary)
- send metadata on connection (use compression?)
- coders/encoders as plugins include custom one (messagepack, protobuf, etc), we could use generics if code will be rewriten to typescript
- cert pinning (server/client-side)