Write a Python3 program called display.py to retrieve files from a web server via HTTP. Although this program could retrieve files of any type, we will use it solely to retrieve image files. and then display them after they have been downloaded.

Program requirements:

  1. Your program must download image files from a web server via HTTP using the Python3 programming language and the socket module.
    1. Warning: Python has a built-in HTTP client module and URL request module.You *cannot* use these (or anything similar) for this lab, however, and zero points will be awarded if you do! The reason for not using this module is because it hides how the HTTP protocol works, and the purpose of this lab is to actually learn about the protocol operation. Instead, you must use the lower-level socket module.
  2. The HTTP Request sent to the server must be printed out on the screen
  3. The HTTP Response received from the server must be printed out on the screen (just the header, not the data)
  4. The entire response from the server must be downloaded in increments of max_recv bytes per system call to recv(). (This is a variable defined in the boilerplate code, and is a reasonable value such as 64kB).
  5. Downloaded files must be saved to local disk with the same file name as on the server.
  6. Downloaded files must be displayed on screen by invoking the eog image viewer utility (see code at the end of the boilerplate file to do this)
  7. Your program will take 2 command-line arguments: the web server port number, and the URL of the image to display,

Get 15% discount on your first order with us
Use the following coupon

Order Now

Hi there! Click one of our representatives below and we will get back to you as soon as possible.

Chat with us on WhatsApp