Skip to content

Instantly share code, notes, and snippets.

@takenoko-str
Created November 30, 2016 16:19
Show Gist options
  • Save takenoko-str/eb4d6a8557a77266d9e186cede2c8ed6 to your computer and use it in GitHub Desktop.
Save takenoko-str/eb4d6a8557a77266d9e186cede2c8ed6 to your computer and use it in GitHub Desktop.
import socket
target_host = "www.google.com"
target_port = 80
client = socket(socket.AF_INET, socket.SOCK_STREAM)
client_connect((target_host, target_port))
client.send("GET / HTTP/1.1\r\nHost: google.com\r\n\r\n")
response = client.recv(4096)
print(response)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment