Assignment Statement:
We often access the web through a proxy. Squid is a caching and forwarding HTTP web proxy. In this
assignment, you have to write a program using sockets in the C language, without using any high level
libraries, to download the main page and logo from [login to view URL] through a squid proxy,
which has been set up by the instructors. The proxy configuration is as follows:
Server: [login to view URL]
Port: 13128
Login: csf303
Password: csf303
If you receive a HTTP 30x response you have to handle that and follow the redirection. You have to
figure out the HTTP protocol for proxy access on your own. It will help to set your browser to the
above proxy, access [login to view URL] from the browser and look at Wireshark traces from your
browser while the request is being made and responded to. Also refer to the HTTP 1.1 RFC. For
simplicity, just write a single program http_proxy_download.c, which should run as follows:
$ gcc http_proxy_download.c -o [login to view URL]
$ ./[login to view URL] [login to view URL] [login to view URL] 13128 csf303 csf303 [login to view URL] [login to view URL]
where, as would be obvious, the command line arguments are respectively the URL, proxy IP, proxy
port, login, password, filename to save html as, filename to save logo as.
Do not hardcode any parameter in your program! Your program should work even if the proxy IP
changes, or the login/password changes, or BITS changes its logo image, or the base URL is changed.
You will submit just the single http_proxy_download.c file. The program must compile and run on
Ubuntu 18.04 or Ubuntu 20.04. If you need access to these environments, please write on Piazza.
The first line of the file should contain the BITS email and name of the student exactly in the
prescribed format below. Also briefly describe your approach in comments following the group
member details.
Test cases:
1. Correct download of [login to view URL] and the logo (you can hardcode the location and
name of the logo file in the base html for this test case)
2. Correct download of a second website (logo will not be checked)
3. Correction download of a third website (logo will not be checked)
We have allowed the following domains to be accessed through the proxy to enable you to test your
code:
• .[login to view URL]
• .[login to view URL]
• .[login to view URL]
We will use automated evaluations on Ubuntu systems and marking will be binary (either it
works or doesn’t), so it is very important to ensure that you adhere to the guidelines. If you do
not adhere to the guidelines and our parser fails to extract your names you will not be marked
for this assignment. We will also use heuristics in our parser to check that you have used the correct
libraries, have not used higher level libraries, and have no hardcoded parameters. There will be no
manual rechecking for part marking if your program fails the tests. We will release a test script
which you can use to test that the names and IDs are being correctly parsed.