Skip to content

fix(socketio): attach to a server built on uWebSockets.js - #3731

Open
nigrosimone wants to merge 1 commit into
feathersjs:dovefrom
nigrosimone:fix-socketio-uws
Open

nigrosimone wants to merge 1 commit into
feathersjs:dovefrom
nigrosimone:fix-socketio-uws

Conversation

@nigrosimone

Copy link
Copy Markdown

Summary

Some Express compatible servers are built on uWebSockets.js and expose the uWS app as uwsApp, for example ultimate-express and fulmine.js. With express(feathers(), ultimateExpress()) REST works, but setup(server) does new Server(server) and socket.io can not attach, so the websocket connection fails.

Now when the server has uwsApp (and no port is given), socket.io is created without a server and attached with io.attachApp(server.uwsApp). Other servers are unchanged.

Test: app.setup() with a callable server carrying a stub uwsApp, socket.io registers its routes on it. It fails without the fix. I also ran a Feathers app with REST, socket calls and the realtime event on Express, ultimate-express and fulmine.js, the output is the same.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant