Proto/tests/secure.py

19 lines
419 B
Python
Raw Permalink Normal View History

2023-11-18 09:59:36 +00:00
import socket
from struct import pack, unpack
from time import time, sleep
2023-11-18 19:24:09 +00:00
from binascii import unhexlify
2023-11-18 09:59:36 +00:00
def sock():
addr = ("localhost", 13370)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(addr)
return s
def test(s):
2023-11-18 19:24:09 +00:00
s.sendall(b"\x04\x01\x0010x snoeperfloep,123x sapperflap\x11")
2023-11-18 09:59:36 +00:00
print(s.recv(1024))
s.close()
2023-11-18 19:24:09 +00:00
def insane(s): s.sendall(unhexlify("03050105050500"))
insane(sock())