Professional Documents
Culture Documents
Networks Mini-Project: SASHANK GONDALA, 120050050
Networks Mini-Project: SASHANK GONDALA, 120050050
Features
Implemented the following
1) GET request
2) HEAD request
3) HTTP1.1
a) Persistent Connection.
b) Keep alive timeout
4) HTTP 1.0
c) Persistent
d) Non Persistent
5) MultiThreaded server
Usage
1)
2)
3)
4)
javac HTTPServer.java
java HTTPServer <port> - If no port is mentioned, port 7777 is selected by
default
To make connection, open a browser and enter http://ip:port/~user/
Additionally, added support to run connections of the form http://ip:
port/~user in persistent setting. The problem with this arises because after
the request for index.html, from next request, the request header does not
contain the userName. So, userName needs to be stored as a state. But this
cannot be done if new connection is started after index.html request, as we
dont have userName stored. So this does not work in non-persistent
scenarios.
References
* Header formats and packet formats - http://www.jmarshall.
com/easy/http/#responseline
* Basic Socket programming - http://www.tutorialspoint.
com/java/java_networking.htm
* Basic MultiThreading - http://www.tutorialspoint.
com/java/java_multithreading.htm
* Bash commands in java - http://ubuntuforums.org/showthread.php?
t=319735
* Basic Java Tutorial - http://www.tutorialspoint.com/java/