Socket.io Client with Vue
socket.io-client, io(url), socket.on/emit, reactive Vue state from socket events.
Why Socket.IO?
Raw WebSockets are low level. Socket.IO is a popular library that adds automatic reconnection, fallback transports, rooms, and a clean event-based API on top.
It has matching server and client packages; here we focus on the browser client used inside Vue.
Installing the Client
Add the client package to your Vue project. It is separate from the server package.
// terminal
// npm install socket.io-client
import { io } from "socket.io-client"