Skip to main content Link Menu Expand (external link) Document Search Copy Copied

HW 3: Rust HTTP Server

The Hypertext Transport Protocol (HTTP) is the most commonly used application protocol on the Internet today. Like many network protocols, HTTP uses a client-server model. An HTTP client opens a network connection to an HTTP server and sends an HTTP request message. Then, the server replies with an HTTP response message, which usually contains some resource (e.g. file, text, binary data) that was requested by the client.

In this assignment, you will familiarize yourself with the popular systems programming language Rust by implementing an HTTP server that handles HTTP GET requests. You will provide functionality through the use of HTTP response headers, add support for HTTP error codes, and create directory listings with HTML. The request and response headers should comply with the HTTP 1.0 protocol found here.


Getting started

It is highly recommended that you complete this assignment locally rather than on your Docker setup. Compilation will be much faster, and you will not need to worry about starting up your Docker container and connecting to it.

To set up a local repository, run the following commands directly on your computer (feel free to modify the first command if you would like to set up the repo in a different location):

git clone git@github.com:Berkeley-CS162/studentXXX.git ~/code/personal # CHANGE THIS!
cd ~/code/personal
git remote rename origin personal 
git pull personal main
git remote add staff git@github.com:Berkeley-CS162/student0.git 
git pull staff main
cd hw-http-rs

If you would prefer to use Docker, ssh into your container and pull the skeleton code from the staff repository:

cd ~/code/personal
git pull staff main
cd hw-http-rs