Skip to main content

CIS 371

Simple Web Server

Winter 2025

You may optionally complete this homework in teams of two. When you follow the link below, you will be given the option to either create a new team, or join an existing team.

GitHub Classroom URL: https://classroom.github.com/a/-zMjkgY8
This video demonstrates how to use GitHub Classroom with this assignment.

Objective

Learn the inner workings of a basic web server to better understand what underlies web platforms. In particular, students will observe the details of

Details

Write a simple web server. You may (but are not required to) use my_http_server.py as a starting point. (This file is nearly identical to the code I walk through in this video. You may use any language you like; you are not required to use Python.

Your web server must:

Challenges

If you are looking for a challenge, try these. (These are just for fun. They are not required.)

  1. Make your server multi-threaded so that it can serve multiple requests at once.
  2. Implement an HTTPS server. Warning: I hear that getting the certificates set up correctly can be challenging. I've never done this; so, if you run into trouble, I'll be of limited help.

Rules

Submission and Grading

If you use Python, this project will be partially auto-tested using GitHub Actions. Begin by using following this link to create a repository for this project. Once you have created your repository for this assignment, clone the repo to your local machine. Your repository will contain the following files:

my_http_server.py
This is the example I covered in the video (plus a little bit of extra sample code you might find helpful). You don't have to use this file, or any of the code in it.
http_socket.py
This is the socket "wrapper" used by the sample code. You are welcome to modify this if you like.
.github
Configuration files for GitHub Actions. Don't mess with files here. (Attempting to modify the testing process to either (1) create a "false pass", or (2) examine the test cases is a serious violation of the CIS Academic Honesty Policy.)
studentData
This directory contains files you can use to test your server.
testPlan.txt
Complete this document to specify how you will test your server.
MyStaticWebServer.java
This is the starter code for the Java version of the assignment. You are welcome to use it if you find it helpful.

Steps for completion and submission

  1. Begin by writing your test cases. Look through the requirements above, and write a short paragraph describing how you will verify that your server meets each requirement. (testPlan.txt includes a couple samples.)
  2. Write your code. Make sure your name appears in all files.
  3. If you are using Python for this assignment, name your file my_http_server.py so the autograder can find it. (If you aren't using Python, I'll have to run the tests by hand.)
  4. When your code passes all of your tests, push to the main branch.
  5. Go to the Actions tab on the GitHub page for this project and launch the tests.
  6. If your code fails my tests:
    • Figure out what is missing from your test plan and add it.
    • Fix your code
    • Resubmit.
    Your test plan should indicate which tests were added in response to failing CI builds. (If you have many failing CI builds, but no additional tests cases, I'll know you didn't follow the testing procedure.)
  7. When your code passes the GitHub tests, schedule a demo with me.

Hints and Reminders


Updated Monday, 10 February 2025, 12:09 PM

W3c Validation