18 lines
442 B
Python
18 lines
442 B
Python
import socket
|
|
|
|
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
client.connect(('vyatsu.ru', 80))
|
|
request = (
|
|
"GET / HTTP/1.1\r\n"
|
|
"Host: vyatsu.ru\r\n"
|
|
"User-Agent: python-requests/2.31.0\r\n"
|
|
"Accept-Encoding: gzip, deflate\r\n"
|
|
"Accept: */*\r\n"
|
|
"Connection: keep-alive\r\n"
|
|
"\r\n"
|
|
)
|
|
client.sendall(request.encode())
|
|
response = client.recv(4096)
|
|
print(response.decode(errors="ignore"))
|
|
client.close()
|