Mapping a Socket.io id to a known User using an example Vue component.

InstructorMark Barton

Share this video with your friends

Send Tweet

Often we need to send data to specific users or groups of users using Socket.io, but by default Socket.io only provides a unique volatile ID so this lesson will demonstrate how we can map on the Server a known User with that Socket ID.

The lesson will build a new Vue component which will allow a User to select their name and group and then send this information from the client to the server using the Socket.

This lesson will also use SessionStorage to store this information so if the browser is refreshed then the component will be auto populated and the details sent to the server.