Loading...

Build your own HTTP server

Learn about TCP servers, the HTTP protocol and more

Start Building
http-server
Python
http-server
Rust
http-server
Go
http-server
C
http-server
C++
http-server
C#
http-server
Gleam
http-server
Haskell
http-server
Java
http-server
JavaScript
http-server
Ruby
http-server
TypeScript
http-server
Elixir
http-server
Kotlin
http-server
Zig
http-server
Clojure
http-server
Dart

HTTP is the protocol that powers the web. In this challenge, you'll build a HTTP server from scratch using TCP primitives. Your server will be capable of handling simple GET/POST requests, serving files and handling multiple concurrent connections.

Along the way, we'll learn about TCP connections, HTTP headers, HTTP verbs, handling multiple connections and more.

Stages

Bind to a port
Respond with 200
Extract URL path
Respond with body
Read header
Concurrent connections
Return a file
Read request body

HTTP Compression

Compression headers
Multiple compression schemes
Gzip compression

Persistent Connections

Persistent connections
Concurrent persistent connections
Connection closure