WebSocket is the H5 specification, which is a standard H5 socket protocol
Socket.IO is a variety of polling mechanisms and other real-time communication methods, and encapsulates a common interface. These methods include Adobe Flash Socket, Ajax long polling, Ajax Multipart Streaming, persistent Iframe, JSONP polling, etc. WebSocket is just one of them. When socket. IO detects that the current environment does not support WebSocket, it automatically selects the best way to realize real-time network communication.