Skip to content
This repository has been archived by the owner on Oct 14, 2020. It is now read-only.

Can server code be improved? #8

Open
eddyystop opened this issue Jul 1, 2017 · 0 comments
Open

Can server code be improved? #8

eddyystop opened this issue Jul 1, 2017 · 0 comments

Comments

@eddyystop
Copy link
Member

This works in Primus. Can something similar be done for socket.io?

let socketResolve;
app.set('socket', new Promise((resolve) => {
  socketResolve = resolve;
  return null;
}));
app.configure(primus({
  transformer: 'engine.io'
}, (socket) => {
  socketResolve(socket);
}));
1 Comment Collapse

This works alright enough for bluebird and primus to get the socket available to the server side

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant