nos0s/common/client.py

14 lines
406 B
Python

import config_loader
import socket
import log
class Client:
def __init__(self):
self.config = config_loader.get_config()
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect((self.config['server']['host'], self.config['server']['port']))
s.sendall(b'Hello world')
data = s.recv(1024)
log.error(f'> Received {data!r}')