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.
It is highly recommended that you complete this assignment locally rather than on your VM. Compilation will be much faster, and you will not need to worry about starting up your VM 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 firstname.lastname@example.org:Berkeley-CS162/studentXXX.git ~/code/personal # CHANGE THIS! cd ~/code/personal git remote rename origin personal git pull personal main git remote add staff email@example.com:Berkeley-CS162/student0.git git pull staff main cd hw-http-rs
If you would prefer to use your VM, log into your VM and pull the skeleton code from the staff repository:
cd ~/code/personal git pull staff main cd hw-http-rs