An Interest In:
Web News this Week
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
- March 27, 2024
- March 26, 2024
July 9, 2021 02:02 pm GMT
Original Link: https://dev.to/fletch0132/new-to-node-js-and-struggling-with-socket-io-o75
New to node.js and struggling with socket.io
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
Original Link: https://dev.to/fletch0132/new-to-node-js-and-struggling-with-socket-io-o75
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To