Reading 18 Socket.io - liz-kavalski-401-advanced-javascript/seattle-javascript-401n13 GitHub Wiki

WebSocket

  • WebSocket is a computer communications protocol.
  • WebSocket is designed to work over HTTP ports 80 and 443 as well as to support HTTP proxies and intermediaries.
  • More like a handshake between the client and the server.

Socket.IO Tutorial

  • Socket.IO enables real-time bidirectional event-based communication
  • Built on top of the WebSockets API (Client side) and Node.js
  • It has two parts: a client-side library that runs in the browser, and a server-side library for node.js
  • Real-Time Application (RTA) is an application that functions within a period that the user senses as immediate or current like instant messages or online gaming.
  • Very popular to use.
  • Broadcasting means sending a message to all connected clients.
  • Socket.IO allows you to “namespace” your sockets, which essentially means assigning different endpoints or paths
  • Within each namespace, you can also define arbitrary channels that sockets can join and leave, also known as 'rooms'.
  • A way to handle errors (https://www.tutorialspoint.com/socket.io/socket.io_error_handling.htm)
  • Has a way to debug

Difference Between WebSocket vs Socket.io