Question: HTTP over TCP, should be implemented using Python 2 or 3 In this assignment, you are to implement client-server communication over TCP transport-layer protocol using

HTTP over TCP, should be implemented using Python 2 or 3

In this assignment, you are to implement client-server communication over TCP transport-layer protocol using HTTP application-layer protocol. You are to submit code for two programs: one for client side (e.g. TCPClient.py) and one for server side (e.g. TCPServer.py). I REQUEST PLEASE TRY TO HELP.... I DON'T KNOW FOR SOME REASON I'M UNABLE TO CONNECT SERVER AND CLIENT SOCKETS (IM GETTING CONNECTIONREFUSED ERROR). PLEASE HELP ASAP....THANKS IN ADVANCE

HTTP over TCP, should be implemented using Python 2 or 3 In

this assignment, you are to implement client-server communication over TCP transport-layer protocol

Requirements for server-side code: 1. Accepts and parses the HTTP GET request. 2. Gets the requested object from the server's file system*. 3. Creates an HTTP response message consisting of the requested object preceded by an appropriate response status line. 4. Sends the HTTP response directly to the client. 5. Sends an HTTP 404 Not Found" response back to the client if the requested object is not present. Requirements for client-side code: 1. Connects to the server using a TCP connection. 2. Sends an HTTP GET request to the server. 3. Displays the server response as an output. 4. Takes command line arguments specifying the server IP address, the port at which the server is listening, and the name of the requested object. Sample command to run the client code: python TCP Client.py server_ip server_port filename Sample outputs of client code: at@at:~$ python TCPClient.py 192.168.1.12 12000 index.html HTTP request to server: GET /index.html HTTP/1.1 Host: 192.168.1.12 HTTP response from server: HTTP/1.1 200 OK

CSC 450: Computer Networks

Assignment #2

at@at:-$ python TCPclient.py 192.168.1.12 12000 home.html HTTP request to server: GET /home.html HTTP/1.1 Host: 192.168.1.12 HTTP response from server: HTTP/1.1 404 Not Found Sample output of server code: at@at: $ python TCPServer.py The server is ready to receive... HTTP request: GET /index.html HTTP/1.1 Host: 192.168.1.14 Object to be fetched: index.html Object content:

CSC 450: Computer Networks

Assignment #2

HTTP response message: HTTP/1.1 200 OK

CSC 450: Computer Networks

Assignment #2

HTTP request: GET /home.html HTTP/1.1 Host: 192.168.1.12 Object to be fetched: home.html HTTP response message: HTTP/1.1 404 Not Found *Put an HTML file (e.g. index.html) in the same directory with the server code. When the server code is running, you should be able to access the index.html file (in browser) through server_ip:server_port/filename (e.g. 192.169.25.33:11000/index.html). Gets the requested object from the server's file system means opening and reading index.html file in server code (e.g. f = open(filename) ... f.read(), where filename is index.html)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!