Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using python 3 Create a simple python program that uses a socket to interact with a server. Note that your program MUST USE THE PYTHON

Using python 3

Create a simple python program that uses a socket to interact with a server. Note that your program MUST USE THE PYTHON SOCKET API. Yes, it is possible to do this in one line of code with Python Requests or some other library. But that wouldnt be any fun, would it?

Your program shall make a socket connection to the host: gaia.cs.umass.edu and send the GET request for the URI: /wireshark-labs/INTRO-wireshark-file1.html. To do this, you will send the following HTTP-compliant GET request to the server exactly as shown:

"GET /wireshark-labs/INTRO-wireshark-file1.html HTTP/1.1 Host:gaia.cs.umass.edu

Run your program and receive a response from the server. It should look like this:

image text in transcribed

Williams-MacBook-Pro:Projecto williampfeil$ python connect_socket.py Request: GET /wireshark-labs/INTRO-wireshark-file1.html HTTP/1.1 Host:gaia.cs.umass.edu [RECV] - length: 382 HTTP/1.1 200 OK Date: Thu, 13 Feb 2020 21:56:16 GMT Server: Apache/2.4.6 (Centos) OpenSSL/1.0.2k-fips PHP/5.4.16 mod_perl/2.0.11 Perl/v5.16.3 Last-Modified: Thu, 13 Feb 2020 06:59:01 GMT ETag: "51-59e6f9fb89784" Accept-Ranges: bytes Content-Length: 81 Content-Type: text/html; charset=UTF-8 Congratulations! You've downloaded the first Wireshark lab file! Williams-MacBook-Pro:Projecto williampfeil$ python connect_socket.py Request: GET /wireshark-labs/INTRO-wireshark-file1.html HTTP/1.1 Host:gaia.cs.umass.edu [RECV] - length: 382 HTTP/1.1 200 OK Date: Thu, 13 Feb 2020 21:56:16 GMT Server: Apache/2.4.6 (Centos) OpenSSL/1.0.2k-fips PHP/5.4.16 mod_perl/2.0.11 Perl/v5.16.3 Last-Modified: Thu, 13 Feb 2020 06:59:01 GMT ETag: "51-59e6f9fb89784" Accept-Ranges: bytes Content-Length: 81 Content-Type: text/html; charset=UTF-8 Congratulations! You've downloaded the first Wireshark lab file!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

2nd Edition

0471180742, 978-0471180746

More Books

Students also viewed these Databases questions

Question

2. Place a value on the outcomes.

Answered: 1 week ago