Documentos de Académico
Documentos de Profesional
Documentos de Cultura
u0349111
CS 4480: Computer Networks
PA1-Final
February 16, 2016
Discuss the TCP Proxy server for assignment PA1. Design, Testing, & Output
Design that describes the program design, how it works and any design tradeoffs considered and
made.
My proxy server, written in Java, has a listening socket connection on a given port that’s passed
in to the command line. When a new connection is initialized, it is handed off to an object of
TCPProxyServer. For Part B, the proxy server worked fairly fast and efficient since I was
passing the bytes straight to back to the client as they came back form the remote server. There
are around 10 validations and/or parsings that happen on each request/header line. This didn’t
seem to slow the connection very much compared to caching the response and processing it. A
expensive problem is that I stored all the response bytes into a dynamic array (ArrayList) and
then back to a standard array. I did this because you obviously can’t hash the file until you
have all of it. These were the main tradeoffs. Caching is necessary in this case but the tradeoff
that left a bad taste in my mouth though was that I had to switch between Byte arrays and
byte arrays. Performance can be hit or miss. It often is dependent on how long it takes to
receive a response from Team Cymru.
Testing that describes the tests you executed to convince yourself that the program works
correctly. Also document any cases for which your program is known not to work correctly.
<h1>Real Simple</h1>
</body>
</html>
I ran the proxy server on my Macbook Pro along with the Apache server and had Firefox
configured on my Windows machine. Using Firefox:
An example of compiling and running the program on the Cade machines on port 1111:
HTTP/1.1 200 OK
Date: Mon, 22 Feb 2016 04:43:35 GMT
Server: Apache/2.4.7 (Ubuntu)
Last-Modified: Sun, 12 Jan 2014 04:01:24 GMT
ETag: "46-4efbe03469098"
Accept-Ranges: bytes
Content-Length: 70
Vary: Accept-Encoding
X-Frame-Options: sameorigin
Connection: close
Content-Type: text/html
<!DOCTYPE html>
<html>
<body>
<h1>Real Simple</h1>
</body>
</html>
HTTP/1.1 200 OK
Date: Mon, 22 Feb 2016 06:39:58 GMT
Server: Apache/2.4.7 (Ubuntu)
Last-Modified: Sun, 12 Jan 2014 04:01:24 GMT
ETag: "46-4efbe03469098"
Accept-Ranges: bytes
Content-Length: 70
Vary: Accept-Encoding
X-Frame-Options: sameorigin
Connection: close
Content-Type: text/html
<!DOCTYPE html>
<html>
<body>
<h1>Real Simple</h1>
</body>
</html>
No HTTP Version
Andrews-MacBook-Pro-2:Desktop Emrazian$ telnet localhost 1132
Trying ::1...
Connected to localhost.
Escape character is '^]'.
GET /~kobus/simple.html
HTTP/1.0 400 Bad Request
Connection: close
Invalid domain
Andrews-MacBook-Pro-2:Desktop Emrazian$ telnet localhost 1132
Trying ::1...
Connected to localhost.
Escape character is '^]'.
GET baddomain HTTP/1.0