kirdy/echo_eth_test.py

15 lines
330 B
Python

# echo-client.py
import socket
#192, 168, 1, 132
HOST = "192.168.1.132" # The server's hostname or IP address
PORT = 1337 # The port used by the server
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect((HOST, PORT))
s.sendall(b"Hello, world")
data = s.recv(1024)
print(f"Received {data!r}")