Last Updated: May 22, 2026
HTTP rides on top of TCP, and every net/http server in Go is really a TCP server with a request parser bolted on. When you need a custom wire protocol, a long-lived connection, or anything that doesn't fit request-response, you drop down to the net package and speak TCP directly. This lesson covers how to listen, accept connections, handle each one in its own goroutine, set deadlines, and shut the whole thing down cleanly.