...

Build Your Own HTTP Server from Scratch | CodeCrafters Challenge

Build Your Own HTTP Server from Scratch | CodeCrafters Challenge

One of the best ways to learn a technology is to build it from the ground up. That’s the premise of CodeCrafters, which offers a catalog of challenges to build popular tools and technologies from scratch (think things like Docker, Git, Redis, a DNS server, etc.).

?***CodeCrafters Affiliate Link***?
Sign up here: https://app.codecrafters.io/join?via=tinytechnicaltutorials

In this video, I’ll walk you through the “Build your own HTTP server” challenge. Using the platform, you’ll build a HTTP server that’s 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.

The idea of CodeCrafters is to “learn by doing,” and there are lots of ways to write the code. I’ll show you code examples and hints that you can use to get you started writing your own code. There’s no completed code for download (as that would kind of defeat the point ?).

?***TIMESTAMPS***?
00:00 – Building an HTTP server from scratch
00:42 – What is CodeCrafters and what kinds of challenges can I work on?
02:04 – Starting the challenge to build your own HTTP server from scratch, with Python
03:33 – Setting up the GitHub repository for a CodeCrafters challenge
03:58 – The leaderboard in CodeCrafters
04:16 – Cloning and pushing to the CodeCrafters repository
05:39 – Creating the HTTP server and binding to a port
08:13 – Responding to an HTTP request with a 200 OK response
11:20 – Responding to an HTTP request with a 404 Not Found response
14:23 – Responding to an HTTP request with content
16:18 – Parsing HTTP headers
17:20 – Handling multiple concurrent requests to the HTTP server
19:13 – GET a file through HTTP and display the contents
21:13 – POST a file through HTTP
22:49 – Completing the challenge and what comes next

Discover more from WIREDGORILLA

Subscribe now to keep reading and get access to the full archive.

Continue reading