Programming Assignment 1:HTTP Web Proxy Server

Hello, if you have any need, please feel free to consult us, this is my wechat: wx91due

Programming Assignment 1:HTTP Web Proxy Server
Programming Assignment (Python based )(2025)

  • Due Monday by 17:00
  • Points 25
  • Submitting an external tool
  • Available after 10 Mar at 9:00
Adapted from Kurose & Ross.Computer Networking: a top-down approach featuring the IntemetCBOK categories: Impacts of ICT,Working Individually,ICT Fundamentals,ICT

Infrastructure, Computational Science and Engineering In this practical, you will learn how web proxy servers work and one of their basic functionalities - caching.

Task

Your task is to develop a small web proxy server which is able to cache web pages.

It is a very simple proxy server which only understands simple HTTP/1.1 GET-requests but is able to handle all kinds of objects - not just HTML pages, but also images.

Documenting your code (assessed)

Although this practical is marked automatically, all marks will be moderated by a marker using the following information.You must add a comment explaining the changes you've made to each of your repository commits. In other words, each commit should explain what was changed in the code and why briefly (e.g. it may be a bug fix or a protocol behaviour fix).

We should be able to review your development process and see the changes made to code with each version you have committed. Please keep in mind that we can check the number of lines of code as well as actual code changes made with each commit.

During manual marking and academic integrity checks, we will look at your development process. If we do not see a clear path to a solution (i.e. code changes and regular commits and comments reflecting your learning to develop the protocol you will forfeit 50% of the marks allocated for this programming assignment and in the extreme case you will be allocated a mark of 0%. An example case of a 0% would be the sudden appearance of working code passing multiple tests.

It is up to you to provide evidence of your development process.

Example of what we can expect to see in your log commit messages (text extracted from a related by different programming assignment):

Added code to send status code 2000 for a successful response. Tested with telnet on local
machine
-......
-.._..
rX|xxxxx1xxxx-XX-XX 13:20:41 +1030(5un,06 Mar 2022) 1 1 line
Parse HTTP request from client and fill in http request struct and tested the code on local
machine
---....-==-==---------------------------------- ----=--=--------------------------
--------
rX | xxxxxx 1xxxx-XX-XX 15:33:14 +1030 (5at,05 Mar 2022) 11 line
..
First automated test failed. Bug: I hard coded the port number. Fixed.
rx1xxx00X1xXX-XX-XX 15:04:48 +1030 (5at,05 Mar 2022) 1 1 line
...
Create socket to listen for incoming connections from client and tested on local machine.
rx|xxxXx1xxxx-XX-XX 15:03:22 +1030 (5at,05 Mar 2022) 1 1 line
...

Note: Multiple Gradescope submits are not necessary, just regular commits with meaningful documentation is enough.

Code & Coding: One important thing to do to void disappointment at the end. lf you submit code that hangs, crashes or does not compile on the student Linux image used by the machines that run the Gradescope system (this image is on machines in the CATS suite or you can remote access via SSH into uss.cs.adelaide.edu.au and pull your code from GitHub, you can also use https://adapt.adelaide.edu.au/ (https://adapt.adelaide.edu.au/). to get access to a student desktop and use Putty to ssh to uss.cs.adelaide.edu.au) you will get an automatic zero.

1. Because this is a third year CS course, please understand that we will not allocate partial marks for code that does not run or fix your code and then run it to give you marks.
2. Only code that is submitted via the Gradescope system will be marked and ,any code on personal machines, e-mailed etc. will not be marked.
3. Please use github, from the start, and commit code and test often.

How to use Github

You will need to keep your files in github. If you aren't familiar with github, you can sign up and use github for free as a student.Go to github.com to signup and for tutorials.

Python Version

The labs and test machines are running Python 3.13. Make sure that your submission is compatible.

Introduction

In this practical, you will learn how web proxy servers work and one of their basic functionalities, caching. Generally, when a client (e.g. your browser) makes a web request the following occurs:
1. The client sends a request to the web server
2. The web server then processes the request
3. The web server sends back a response message to the requesting client
And let's say that the entire transaction takes 500 ms.

In order to improve the performance, we create a proxy server between the client and the web server. The proxy server will act as a middle-man for the web transactions.Requesting a web request will now occur in the following steps:
1. The client sends a request to the proxy server
2.Skip to step 7 lf the proxy server has cached the response
3. Forward the request to the web server
4.The web server processes the request
5. The web server sends a response back to the proxy server
6. The proxy server caches the response
7. The proxy server returns the cached response to the client
On the first request, the transaction may be a fraction longer than the previous example.

However, subsequent requests will be significantly faster due to reduced network latency and server load (sometimes less than 10 ms).

The mechanism for caching can be as simple as storing a copy of a resource on the proxy server's file system.
The standard you are using,HTTP1.1, in your programming assignment is described in detail in RFCs (request for comments)

[see: https://en.wikipedia.org/wiki/Request for_Comments]_(Links to an external site.)
(https://en.wikipedia.org/wlkl/Request_for_Comments)
HTTP1.1 RFC we use is2616[https://tools.jetf.org/html/rfc2616B(https://tools.letf.orglhtml/rfc2616)]

Please read Section 5.1.2 in RFC 2616.

You can read more about caching and how it is handled inHTTP in RFC 2616 in Section 13.

Now we want you to aim for the correct protocol/proxy behavior (see the marking rubric at the end of the practical description for what we will look for).

Steps for approaching the practical

Step 1
Understand theHTTP/1.1 requests/responses of the proxy. Your proxy MUST be able to handle GET requests from a client. Your proxy may handle other request types (such as POST) but this is not required.
You need to know the following:

1.What HTTP request will the browser send to the proxy?
2.What wi HTTP response look like?
3. In what ways will the response look different if it comes from the proxy than if it comes from the origin server (i.e. the server where the original page is stored?). You will not be able to test this yet, but what do you think would happen?
Step 2

Understand the socket connections:
1.How will the client know to talk to the proxy?
2.What host and port number will the proxy be on?
3.The proxy may need to connect to the origin server (if the web object is not in the cache), what host and port number will the proxy connect to?

发表评论

电子邮件地址不会被公开。 必填项已用*标注