Creating a Static HTTP Server with Rust – Part 2

In this series, we are creating a basic static HTTP 1.0 server with Rust. If you haven’t seen Part 1 yet, go do that first. At the end of Part 2, our server will do the following:

  • Read and serve files from a predefined directory on the host server
  • Generate appropriate HTTP responses to incoming requests
  • Log information about the response to standard output
Continue reading Creating a Static HTTP Server with Rust – Part 2

Creating a Static HTTP Server with Rust – Part 1

In this series, we will create a basic static HTTP 1.0 server with Rust. At the end of Part 1 of this tutorial, our server will do the following:

  • Listen for and handle TCP connections on a specific port
  • Accept HTTP 1.0 GET requests
  • Parse and validate requests for further use
  • Log incoming requests

We will avoid using libraries that make this trivial (i.e. the http crate) and focus on the fundamentals of how a server works. Let’s get started.

Continue reading Creating a Static HTTP Server with Rust – Part 1