Write a simple web server that recognizes only the GET request (without the Host: request parameter and

Question:

Write a simple web server that recognizes only the GET request (without the Host:

request parameter and blank line). When a client connects to your server and sends a command, such as GET filename HTTP/1.1, then return a header HTTP/1.1 200 OK followed by a blank line and all lines in the file. If the file doesn’t exist, return 404 Not Found instead.

Your server should listen to port 8080. Test your web server by starting up your web browser and loading a page, such as localhost:8080/c:\cs1\myfile.html.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  answer-question
Question Posted: