Created
November 30, 2016 16:19
-
-
Save takenoko-str/eb4d6a8557a77266d9e186cede2c8ed6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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