создание клиента, обращающегося к серверу ВГУ
This commit is contained in:
parent
93f5d681df
commit
c9b846daf4
9
tcp_client_vgu.py
Normal file
9
tcp_client_vgu.py
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import socket
|
||||||
|
|
||||||
|
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
|
client.connect(('vyatsu.ru', 80))
|
||||||
|
request = "GET / HTTP/1.1\r\nHost: vyatsu.ru\r\n\r\n"
|
||||||
|
client.sendall(request.encode())
|
||||||
|
response = client.recv(4096)
|
||||||
|
print(response.decode())
|
||||||
|
client.close()
|
||||||
Loading…
Reference in New Issue
Block a user