Official documentation for FastSocket, a Python library for building TCP/UDP servers and clients with support for secure (RSA) communication, chunked transfers, file transfer, and a hybrid TLS mode.
Designed for rapid prototyping and production use with multi-connection handling.
pip install fastsocket
from fastsocket import FastSocketServer, SocketConfig, Queue
def handle_messages(messages: Queue):
while not messages.empty():
msg, addr = messages.get()
print(f"[{addr}] {msg}")
config = SocketConfig(host="localhost", port=8080)
server = FastSocketServer(config)
server.on_new_message(handle_messages)
server.start()