-
-
Save njsmith/5ecda1f24911e54097d63ed1d9c050cd 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 sys | |
import socket | |
host, port = sys.argv[1], int(sys.argv[2]) | |
with socket.create_connection((host, port)) as sock: | |
get = b"GET / HTTP/1.1\r\nHost: " + host.encode("ascii") + b"\r\n\r\n" | |
count = 0 | |
while True: | |
sock.sendall(get) | |
count += 1 | |
if count % 10000 == 0: | |
sys.stdout.write("\rRequests sent: {}".format(count)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment