Starting from:

$25

CSC138- Socket Programming Assignment 3: Web Server Solved

Goal: Practice makes perfect! Socket programming assignments are to help you review and apply your conceptual knowledge from this class.

Attention: Although the examples discussed in class are in Python/C, your submission can be in

Python/C/Java. If you choose do so, the caveat is that there is more help (see below) if you do it in Python. Code plagiarism is absolutely NOT allowed! Please prepare for a demonstration of running your program in front of the instructor/grader and answer their questions.

Instructions: (Textbook Page 179) This is the first of a series of programming assignments in the text book that will be assigned in the course of the semester. Students can find full details of these assignments, as well as important snippets of the Python code, at the Web site for the text book.   http://wps.pearsoned.com/ecs_kurose_compnetw_6/.

In this assignment, you will develop a simple Web server in Python that is capable of processing only one request. Specifically, your Web server will (i) create a connection socket when contacted by a client (browser); (ii) receive the HTTP request from this connection; (iii) parse the request  to determine  the specific  file being requested; (iv) get the requested file from the server's file system;  (v) create an HTTP response message consisting of the requested file preceded by header lines; and (vi) send the response over the TCP connection to the requesting browser. If a browser requests a file that is not present in your server, your server should return a "404 Not Found" error message.

 

In the textbook’s companion Web site, we provide the skeleton code for your server. Your job is to complete the code, run your server, and then test your server by sending requests from browsers running on different hosts. If you run your server on a host that already has a Web server running on it, then you should use a different port than port 80 for your Web server.

More products