
Explore how data packets travel via the tcp/ip stack—from physical cables to http—and how tcp offers reliable, ordered delivery while udp remains fast but unreliable for socket.io and http.
explore how web sockets connect a browser client to a node server using the WebSocket API, a precursor to Socket.IO.
Master the basics of socket.io by wiring an express server and a public client, installing npm modules, and exchanging messages with emit and on for a chat app.
Build a basic Socket.IO chat client and server using Express, port 8001, and a public chat.html with DOM updates, emitting and broadcasting new messages to all connected clients.
Lay out a basic slack-style chat app using express and socket.io, create a server on port 9000, wire namespaces, handle client connections, and emit a welcome message for sanity checks.
Learn how to modularize socket.io namespace joining with a dedicated join ns function, manage dynamic namespace population on reconnect, and enhance ux with optional last namespace storage.
Learn to implement acknowledgments in socket.io v4, using fetchSockets to count users in a room, and update history and UI through join/leave logic and callback responses.
Learn to replace callbacks with emit with ACK in SocketIO v4.6.0, using async/await to capture server acknowledgement; auto join the first room when a namespace loads.
Explore passing data on socket connections using query parameters and the io options, and implement secure credentials via the auth option to protect usernames and passwords during handshake.
Initialize a player orb on a 2d canvas at a random position and render it with arc, fill, and stroke, while mouse movement keeps the orb centered and world moving.
Learn to clamp the game viewport to the player's server-synced position using socket.io v4 with websockets, and make errors loud to avoid silent failures amid async updates.
Explore collision testing for a socket.io game, applying an axis-aligned bounding box test before circle overlap to detect orb collisions and handling player collisions with score, radius, and zoom updates.
Implement and test orb and player collision logic in a Socket.IO v4 game, updating bounds, handling orb swaps with an orb switch event, and syncing client states in real time.
Build a socket.io v4 project that monitors cpu load and memory usage. Learn to connect a React frontend with a node program, with heartbeat and offline handling.
Learn how to scale socket.io with horizontal and vertical techniques, using multiple servers and adapters, including the cluster adapter, while handling sticky sessions and long polling.
Kick off the node client to capture local performance data with the OS module, including CPU load, memory, uptime, and CPU info, for sending to the socket server.
Learn how the node cluster module scales socket.io by spawning multiple worker processes that share a single port, enabling better processor utilization and session continuity for websocket connections.
Establish a socket connection, receive performance data every second, convert it with object.values into an array, and map to widgets by passing data and using Mac address as the key.
Explore the socket.io v4 admin ui, a front-end tool that connects via websockets to monitor clients, transports, rooms, and server activity, demonstrated with an agar.io clone and an express setup.
Websockets are one of the coolest api's to ever hit the web. They allow the browser real-time communication, bridging one of the last gaps in both human and web-based communication. Socket io is the king library that uses websockets under the hood. There's a good chance if you're reading this, you've heard about socketio. Maybe even done a tutorial on it. But how far did you get? In my experience, the vast majority of the material on the web goes no farther than a quick-start, instant chat app. You don't learn how anything works, never look at the docs, and are stuck at the end wondering what to do now. Is that all socketio can do? The remaining shred of material is waaay over everyone's head. The fact that the websocket API was standardized in 2011 and most developers still don't know how to use it is evidence of the gap.
This course is meant to alleviate that! It is not a quick start guide to socket IO. There are loads of those all over the Internet. You should definitely look elsewhere if you are wanting a 10 minute intro to the 3-4 things you need to know to make something quick. On the other hand, if you are looking to really learn one of the most awesome JavaScript libraries in socket io, you should stick around. Like Express and other JavaScript/Node pieces, it's getting passed over in the wave to learn just enough to get to the term "full-stack developer." My main goal is to help you figure out how to go from being a good developer to a great developer. Understanding... not just knowing a few methods... of socketio is part of that! It even transcends the browser and node with implementations in most other languages, and even mobile/React Native. This means as you grow, you have the power of sockets without having to learn more than the socket io library.
I first used socketIO in 2013 for a tiny company directory app. I've been following since and have been frustrated that it hasn't gotten more mainstream notice because it opens the way for so many improvements to existing applications and obvious groundwork for new ones. Let's change that :) Prepare to for a detailed look at socketio and websockets and start going real-time.
Sections:
Introduction - course overview, github link, and the state of socketio and websockets
Before SocketIO... - TCP, network sockets, & a native websockets app
Socket.IO-101 - Why you'd want to use socketio (instead of just websockets), and how it works (simple chat app)
Socket.IO-201 - Making the chat app into a slack clone with namespaces and rooms
Project - real-time canvas game (agar.io-clone)
Project - Real-time performance data (uses React, Cluster, and the Cluster Module. Rotated Redis out until the new module is stable)
Supplemental - HTTP (for those in need of a review)
LEGACY - version 2 - Socket.IO-101
LEGACY - version 2 - Socket.IO-201
LEGACY - multi-player canvas game
LEGACY - Advanced Project
I hope to add sections for a streaming videos/socket.io-stream app, as well as a React Native app.