Pick a depth. Each prompt opens in your AI pre-loaded with the lesson. Click a row to preview the prompt.
A web server is a TCP socket that speaks HTTP. You bind to a port, accept incoming connections, parse an HTTP request out of each one, run your handler, and write an HTTP response. Every framework you've ever used — Express, FastAPI, Actix, Gin — is a wrapper around this one loop. Understanding that loop literally (not metaphorically) is what separates people who can debug a slow server from people who can only add more of them.
Every HTTP framework you've used — Express, FastAPI, Gin, Actix — is a thin wrapper around one loop: bind a port, accept a connection, read bytes, parse HTTP, call your handler, write a response. Seeing that loop directly, without a framework in the way, makes every future abstraction legible. Four languages means four different ways to reach the same socket primitives.
curl -v http://localhost:8080/. Read every line of the response carefully — status, headers, body.:8080 and kill it; understand what bind means.:0 instead of :8080. The OS assigns a random free port. What does the server now print?package main
import (
"fmt"
"net/http"
)
func main() {
// net/http does the TCP + HTTP parsing for you.
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w, "hello")
})
fmt.Println("listening on :8080")
http.ListenAndServe(":8080", nil)
}go run main.go