Please do not use a python code already on the internet. The following code must be written in python for this HW assignment. I will provide a skeleten for the code and you must write some lines of code to satisfy the objective of the prorgram. you need to develop a web server that handles one HTTP request on at a time. the web server should accept and parse the HTTP request, get the requested file from the server’s file system, and create an HTTP response message consisting of the requested file preceded by header lines, and then send the response directly to the client. If the requested file is not present in the server, the server should send an HTTP “404 Not Found” message back to the client. Dont need the hole code just right the information and code it to the skeleten pictures below.
Please do not use a python code already on the internet.
The following code must be written in python for this HW assignment. I will provide a skeleten for the code and you must write some lines of code to satisfy the objective of the prorgram.
you need to develop a web server that handles one HTTP request on at a time. the web server should accept
and parse the HTTP request, get the requested file from the server’s file system, and create an HTTP response
message consisting of the requested file preceded by header lines, and then send the response directly to
the client. If the requested file is not present in the server, the server should send an HTTP “404 Not
Found” message back to the client.
Dont need the hole code just right the information and code it to the skeleten pictures below.
![+Send the content of the requested file to the client
for i in range (0, len (outputdata)) :
connectionSocket.send (outputdata[i).encode ())
connectionSocket.send ("\r\n", encode () )
connectionSocket.close ()
#Send response message for file not found
#Eill in start
end
+Closedelientsoeket](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F784266fd-9635-41bd-95c7-af00625fee00%2Fff3847eb-5f50-47bf-9da4-b1927e77f97c%2Fbbr0wxc_processed.jpeg&w=3840&q=75)
![Fimport Socket module
from socket import *
import sys # In order to terminate the program
serverSocket = socket (AF INET, SOCK STREAM)
#Prepare a sever socket
#Fill in start
#Fill in end
while True:
#Establish the connection
print ('Ready to serve...')
connectionSocket, addr =
#Fill in start
#Fill in end
try:
message
#Fill in start
*Pill in end
filename = message.split() (1
F= open (filename (1:)
outputdata
Fill3
start
#Fill inend
+Send one HTTP header line into socket
1111111 atart](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F784266fd-9635-41bd-95c7-af00625fee00%2Fff3847eb-5f50-47bf-9da4-b1927e77f97c%2F91ygbge_processed.jpeg&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)