Free course
Socket Programming with Node.js
Build TCP and UDP programs with Node.js, frame messages, handle unreliable connections, and design a small protocol you can inspect on the wire.
Prerequisites: JavaScript, Node.js and Networking Foundations
Your progress
of lessons completed.
Course completed.
What you'll learn
Build and test TCP and UDP clients and servers that frame input, apply limits, handle failures, and support multiple clients safely.
Take this course offline
Subscribe to my newsletter to get every free book and course in PDF and EPUB format.
Get the downloadsCourse contents
TCP foundations
Build a TCP server and client, exchange bytes, and control the listening address.
Message framing
Build a newline protocol, buffer partial input, parse JSON messages, and enforce size limits.
Connection reliability
Handle timeouts, half-closes, resets, backpressure, and cleanup without leaking resources.
UDP datagrams
Build UDP endpoints, preserve message boundaries, and add retries, identifiers, and duplicate handling.
Build and test a protocol
Specify commands, validate limits, support concurrent clients, inspect packets, and finish a small service.