How to properly integrate socketio into HyperExpress #254
-
Question into title |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Why would you integrate that mess into a project build on top of uWebSockets.js? |
Beta Was this translation helpful? Give feedback.
-
So it all comes down to which methods / properties / behaviors socket.io expects from the Request / Response object. The best approach would be to drop-in hyper-express in the place of express when creating your socket.io instance then running through all possible test cases / calls to see If something breaks or uncaught errors occur. From this point onwards, you can clone hyper-express and then add the neccessary properties / methods for compatibility and do this until socket.io works properly. |
Beta Was this translation helpful? Give feedback.
So it all comes down to which methods / properties / behaviors socket.io expects from the Request / Response object.
We try to get as close as possible but hyper-express does not have 100% compatibility and who knows which undocumented getters / methods socket.io may be calling internally from Express.js
The best approach would be to drop-in hyper-express in the place of express when creating your socket.io instance then running through all possible test cases / calls to see If something breaks or uncaught errors occur.
From this point onwards, you can clone hyper-express and then add the neccessary properties / methods for compatibility and do this until socket.io works properly.