作业web | 代做report | 代做c++ | java代做 | 代做project | 代做Python | network代写 | socket代写 – Assignment web service using the HTTP protocol

Assignment web service using the HTTP protocol

作业web | 代做report | 代做c++ | java代做 | 代做project | 代做Python | network代写 | socket代写- 这是socket方面代写, 对http协议的流程进行训练解析, 是有一定代表意义的web/report/c++/java/Python等代写方向, 该题目是值得借鉴的project代写的题目

C++语言代写 C++代写 代写C++ 代做C

This project aims to develop a socket program to implement a web service using the HTTP protocol.

Design requirements

In this assignment, you are required to develop a multi-threaded Web server in Python that is capable of processing HTTP requests sent from browsers or some other client programs. This multi-threaded program will be able to handle multiple requests at the same time. 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 servers file system; (v) create an HTTP response message consisting of the requested file preceded by header lines; (vi) send the response over the TCP connection to the requesting client. If the client requests a file that is not present in your server, your server should return a Not Found error message. Your task is to implement the server program, run your server program, and then test your server program by sending requests from the client programs running on different hosts. You may run the server on your own computer, using the IP address of 127.0.0.1. 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. You can develop your code in two stages. In the first stage, you can simply implement the server program to receive the HTTP request messages and display the contents. After this is running properly, you can add the code to generate appropriate responses in the second stage. The Web server needs a log file to record statistics of the client requests. Each request corresponds to one line of record in the log. Write down client hostname/IP address, access time, requested file name and response type for each record. Your Web server also needs to handle some simple errors, such as web-page not found. You can use either Python, java or C/ c++ languages for the project. When implementing the Web server, you are expected to use basic socket programming classes to build the Web server from scratch instead of using the HTTPServer class directly.

Submission requirements

A report that contains o A cover page includes your name and student number; o A summary of your design and implementation of the server program; o A demonstration of executing your program and screen capturing of results of all functions;

o A log file that records the statistics of the client requests. Completed source code o Your code should be commented appropriately. A README text file of how to compile and run your program

Assessment rubrics

Design and implement the Web server program to support the following functions (60 marks + 10 bonus marks) o Multi-threaded Web server (10 marks) o Proper request and response message exchanges (10 marks) o GET command for both text files and image files (10 marks) o HEAD command (10 marks) o Four types of responses ONLY, including 200 OK, 400 Bad Request, 404 File Not Found, 304 Not Modified (10 marks, marks will be deducted if your server program have returned more types of responses) o Handle Last-Modified and If-Modified-Since header fields (10 marks) o Handle Connection: Keep-Alive header field (10 bonus marks) Quality of your report (30 marks) o A good summary of your design and implementation of the server program (10 marks) o A full demonstration of executing your program and screen capturing of results of all functions (10 marks) o A log file that records the statistics of the client requests (5 marks) o A clear README text file (5 marks) Quality of your source code (10 marks) o Good naming and coding convention used in your source code o Compile the source code successfully o Execute the program without runtime errors