This content originally appeared on DEV Community and was authored by Fletcher Moore
Hi all,
Nervous first post but really need some help. I'm working on a Web application for p2p communication (both video and text).
The video communication works (some teething issues), but my main issue is getting user socket.id. specifically the user just having connected.
I have tried many things including:
Socket.on("connected", () {
console.log(socket.id);
});
All I get is "undefined". Yet if I run te same console.log code after the page loads I can get it displayed.
Not sure how to work with that.
I want to store the socket.id and username in an object/array
Thank you
This content originally appeared on DEV Community and was authored by Fletcher Moore
Fletcher Moore | Sciencx (2021-07-09T14:02:10+00:00) New to node.js and struggling with socket.io. Retrieved from https://www.scien.cx/2021/07/09/new-to-node-js-and-struggling-with-socket-io/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.