>

Project 1

Due 11:59pm Monday, Apr 27 (Week 7)

#Overview

In this project, you will implement an HTTP proxy server in C that:

  1. Serves local files if they exist on disk
  2. Proxies requests to a backend server if the file is not found locally

This project gives practical experience with:

#Notices

  1. If you’re using GitHub or a similar tool to track your work, please make sure that your repository is set to private.
  2. As per the syllabus, the use of AI assisted tools is not allowed.
  3. You may do this project in groups of up to 3 people. Please remember to include your whole group in your gradescope submission.

#Specification

Please clone the Starter Code and read the specification on GitHub.

#HTTP Protocol Requirements

Your proxy must support:

#MIME Types

Set the Content-Type header based on file extension:

ExtensionContent-Type
.htmltext/html; charset=UTF-8
.txttext/plain; charset=UTF-8
(default)application/octet-stream

#Error Handling

Your proxy must return appropriate HTTP error responses:

#Architecture

[Client] --> [Your Proxy]
              |
              +-- File exists locally? --> serve from disk
              |
              +-- File not found --> proxy to backend (127.0.0.1:18444)

#Command-Line Interface

./proxy [-b <port>] [-r <host>] [-p <port>]

  -b <port>    Local port to listen on (default: 18443)
  -r <host>    Backend server host (default: 127.0.0.1)
  -p <port>    Backend server port (default: 18444)

#Grading Criteria

The autograder runs 8 tests for a total of 100 points:

TestPoints
Compilation30
Local HTML file10
Local TXT file10
Root /10
Proxy status10
Proxy content10
404 Not Found10
502 Bad Gateway10

#Submission

Submit a ZIP file to Gradescope by 11:59pm on Monday, April 27th. Late submission is allowed until Wednesday, April 29th (10% deduction per day).

The helper zip command creates a compatible ZIP file.

#Resources