Assignment 5:
Client-Server Applications Using Java
The goals of this laboratory session are the following.
-
Install and test some Java clients.
-
Install and test a simple HTTP Java server.
-
Try several simple modifications to above programs.
-
Add some features to the suggested code.
-
finger.java is a Java finger client.
Expn.java uses SMTP Protocol to do address
expansion (try java Expn postmaster@ketu -v , for example). Install and
try them out.
The above take argument(s) from the command line. Modify one/both to
prompt the user for input( maybe in a loop for more than one session) and do
their work.
-
Compile and try HttpClient.java
Sample commands to try.
java HttpClient chandra.cse.iitb.ac.in 80 /
java HttpClient www.iitb.ac.in 80 /dummy
java HttpClient www.cse.iitb.ac.in 80 /
java HttpClient everest 80 /~cs296/
-
Install and run EchoServer
(The above file is a shar file. Download it and execute $sh EchoServer.shar.
This will generate three files : EchoServer.java, NetworkServer.java, SocketUtil.java)
See EchoServer.java.
Use port number 7xyz where xyz are the last 3 digits of your roll number.
Compile and run EchoServer.java.
Connect to your server with various clients(telnet ketu 7xyz , lynx , HttpClient)
and check.
-
New Assignment - write a Joke Server and Client. Allow the user to choose
a joke and return a random one of that type.