You are here: Teaching, Distributed Systems, Week 3
This week's topic is Build your own Web Server.
Internal Page Navigation Links
Learning Outcomes
Upon completion of this week's class and tasks, you should be able to do the following:
- Use HTTP as an example of a request-reply protocol, to demonstrate the requirements for interprocess communication across the network.
- Distinguish between HTTP/1.0 and HTTP/1.1.
- Develop simple client-server based applications using TCP.
- Use the HTTP APIs for Java to build web clients.
- Demonstrate an understanding of how to build a web server using the Java APIs.
Return to the internal page navigation links
Go to the start of the main content
Go to the site navigation links
Notes and Handouts
- Slides: This is a PDF document with this week's notes, with one slide per page. Use this for viewing on your computer.
- Handouts: This is a PDF document with this week's notes, with six slides per page. Use this for printing.
Return to the internal page navigation links
Go to the start of the main content
Go to the site navigation links
Tasks
| Task Number | Details |
|---|---|
| 1 | Download the code for today's class. |
| 2 |
Run the EchoClient and EchoServer applications as follows (as separate processes): java EchoServer 12345 java EchoClient localhost 12345 "Welcome to the House of Fun" |
| 3 |
Run the UserAgent program as follows: java UserAgent http://www.irishtimes.com/ it.html Note how the content of the Irish Times homepage is downloaded and copied into the local file, it.html. Open it.html, but note that since it doesn't download the stylesheets or the images, the file will not render nicely in the browser. |
| 4 |
Run the WebServer program as follows: java WebServer This web server will run of port 8080. Put a HTML file in the same folder as you are running your process, calling it, say, my_file.html. If you then direct your browser to the following URL, you will be able to access your file: http://localhost:8080/my_file.html |
| 5 | Use the UserAgent program to access a file on your web server. |
| 6 | Augment your web server so that it implements the 100 Continue response, simulating slow response times by using Java's Thread.sleep method. |
| 7 | Implement chunked transfer encoding on your web server. |
Return to the internal page navigation links
Go to the start of the main content
Go to the site navigation links
Further Reading
- Instructions on setting up Java.
- Java Tutorial section on URLs.
- HTTP/1.0
- HTTP/1.1
- RFC 1630: Universal Resource Identifiers in WWW
- RFC 1738: Uniform Resource Locators (URL)
Return to the internal page navigation links
Go to the start of the main content
Go to the site navigation links
This is the end of the content of this page. Everything that follows is a link to another page.
Site Navigation Links
Teaching
- Distributed Systems
- Advanced Internet Development
- Object Oriented Programming
- Projects
- Examinations
- Universal Design