1. Engineering
  2. Computer Science
  3. implement in java a simple http 10 server that listens...

Question: implement in java a simple http 10 server that listens...

Question details

Implement in Java a simple HTTP 1.0 server (that listens to port 80) and that can handle HTTP GET requests of browsers. Your server should be able to handle the three types of GET requests: a) Upon receiving a web request of the type http://machine/doc/page (e.g. http://localhost/doc/ page), the server will analyze the request line and search for the specified page in its local directory. If the page can be found, send it to the browser. If the file cant be found return a 404. b) Upon receiving a web request of the type http://machine/echo (e.g. http://localhost/echo ), the server will return a HTML5 page that contains all the data sent by the browser. c) Upon receiving a web request of the type http://machinelog (e.g. http://ocalhost/log), the server will return a HTML5 page that contains a list of all the requests made to the server since t was started. Each log entry must be in a separate line. ·Assume that only HTML5 content will be requested. » Pages must be in the same directory as the server. All requests are well formed HTTP requests. . All requests can be handled sequentially (no need to implement multi-threaded server)

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution