Replies: 1 comment
-
Could you provide the context you're working with? If you're looking to reuse a socket. Here's how I did it: export default function socket(httpServer) {
const io = new Server(httpServer);
io.on("connection", socket => {
// handle connection
});
return io;
} const server = require("http").createServer();
const io = socket(server);
export { io }; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I have configured socket.io in server.js file and its working perfectly
Now I want to emit and send client to some data from a router file.
Can anyone pls tell me how to achieve that?
Beta Was this translation helpful? Give feedback.
All reactions