Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

this is my webclient.py this is my webserver.py I keep running it but none of the information will show up when I run wireshark. Is

this is my webclient.py

student submitted image, transcription available belowstudent submitted image, transcription available below

this is my webserver.py

student submitted image, transcription available belowstudent submitted image, transcription available below

I keep running it but none of the information will show up when I run wireshark. Is something wrong with my code?

This is what I'm supposed to create.

student submitted image, transcription available belowstudent submitted image, transcription available below   
 
 
 
 

1 from socket import * # Import socket module 2 import sys, os, errno 3 import time 4 5 6 7 # Create a TCP server socket #(AF_INET is used for IPv4 protocols) #(SOCK_STREAM is used for TCP) 8 9 clientSocket = socket (AF_INET, SOCK_STREAM) 10 11 12 # Assign a port number # serverPort = 6789 13 14 if len(sys.argv) < 4: 15 16 17 18 " print("Usage: python3 + sys.argv[0] + serverAddr serverPort filename") sys.exit(1) serverAddr = sys.argv[1] serverPort = int(sys.argv[2]) 19 fileName = sys.argv[3] 20 21 # Connect to the server 22 try: 23 24 25 26 27 28 29 sys.exit(1) clientSocket.connect((serverAddr, serverPort)) receive_buffer_size = 4098 clientSocket.setsockopt(SOL_SOCKET, SO_RCVBUF, receive_buffer_size) except error as e: 11 print("Connection to server failed. + str(e)) 30 print('------The client is ready to send- -') print(str(clientSocket.getsockname()) + -->' + str(clientSocket.getpeername())) 31 32 33 try: 34 35 36 getRequest = "GET /" + fileName + HTTP/1.1 Host: + serverAddr + " " getRequest = getRequest + "Accept: text/html Connection: keep-alive " clientSocket.send(getRequest.encode()) 37

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

Step: 3

blur-text-image

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

Contemporary Auditing

Authors: Michael C Knapp

12th Edition

357515404, 978-0357515402

More Books

Students also viewed these Programming questions

Question

3. Distinguish among various types and formats of wills.

Answered: 1 week ago