2 Writing a basic web server from scratch

This chapter covers

  • Writing a TCP server in Rust
  • Writing an HTTP server in Rust

In this chapter, you will delve deep into TCP and HTTP communications using Rust. These protocols are generally abstracted away for developers through the higher-level libraries and frameworks that are used to build web applications. So why is it important to discuss low-level protocols? This is a fair question.

Learning to work with TCP and HTTP is important because they form the foundation for most communications on the internet. Popular application communication protocols and techniques such as REST, gRPC, and WebSockets use HTTP and TCP for transport. Designing and building basic TCP and HTTP servers in Rust will give ...

Get Rust Servers, Services, and Apps now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.