-
Notifications
You must be signed in to change notification settings - Fork 1
/
garbage.py
34 lines (26 loc) · 1.23 KB
/
garbage.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# **************************************************************************** #
# #
# ::: :::::::: #
# garbage.py :+: :+: :+: #
# +:+ +:+ +:+ #
# By: jmykkane <jmykkane@student.hive.fi> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/02/05 14:38:14 by jmykkane #+# #+# #
# Updated: 2024/02/05 14:50:20 by jmykkane ### ########.fr #
# #
# **************************************************************************** #
import socket
import os
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
host = 'localhost'
port = 8080
s.connect((host, port))
http_end = '\r\n\r\n'
for i in range(0, 1000):
random_bytes = os.urandom(512)
s.send(random_bytes)
s.send(http_end.encode())
# response = s.recv(4096)
# print(response.decode('utf-8'))
print(f'sent request: {i}')
s.close()