Hello guest, if you read this it means you are not registered. Click here to register in a few simple steps, you will enjoy all features of our Forum.
Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TCp code explained
#1
Hey guys,

I am new to this field and I would like to get some assistance in explaining this code's output.
Currently when I run it doesn't produce any output. I am using WingIDE.

import socket

target_host = "www.google.com"
target_port = 80

#create a socket object

client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

#connect the client

client.connect((target_host,target_port))

#send some data

client.send("GET / HTTP/1.1\r\nHOST: google.com\r\n\r\n")

#receive some data

response = client.recv(4096)
Quote
#2
add the following after line 20
print(response)
nilamo likes this post
Quote
#3
Thanks! forgot to add that LoL! Dance Dance
Quote

Top Page

Forum Jump:


Users browsing this thread: 1 Guest(s)