-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
35 lines (28 loc) · 2.19 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Authors:
Daniel Evans, Adrian Preston, and Blaise Iradukunda
We built the proxy server starting from the Tiny Server code. We modified almost
everything in the program. One interesting modification was the client_error function
We learned that using sprintf to copy a string to itself plus another string causes
undefined behavior, even though generally speaking it works out. The reason is that
sprintf uses memcpy (at least the glibc implementation) under the hood to ultimately
copy the formatted string and memcpy explicitly says in the man page that overlapping
pointers passed as arguments for copying causes undefined behavior.
We managed to get the proxy working for any non-https site on the web. Sometimes
it takes longer than expected for the "full" page to load even though the entire page
is essentially loaded. This can be seen very well with the "registrar.sewanee.edu"
site. We learned after some inspection that the initial request to the server causes
a cascade of requests to the exact same uri (registrar.sewanee.edu). Some of the requests
are to load other resources for the site (such as css,js, images,etc) however. Furthermore,
inspecting the log file, you would see multiple requests to the registrar page with the same
number of received bytes. We were not sure why this was happening, but it doesn't affect
the overall capabilities of the program (i.e. it still loads the page and the program
can still handle multiple requests at a time)
Improvements to the program could include allowing more access protocols to be
serviceable by our server (such as https) as well as improvements to response speed
by reducing the number the number of requests the proxy has to make to the peer server
(i.e. registrar.sewanee.edu) by implementing a caching system.
------------------------------- BUILDING THE PROGRAM -------------------------------------------
To build the program, type "make server" in the working directory. Then run the program
with "./server <port>", where "<port>" is the port you would like the server to run on.
To make the server work through your browser, you will need to set the proxy settings to work
through localhost on the port you specify when you run the program at the command line.