diff options
| author | Franoosh <uinarf@autistici.org> | 2026-01-10 13:03:05 +0100 |
|---|---|---|
| committer | Franoosh <uinarf@autistici.org> | 2026-01-10 13:03:05 +0100 |
| commit | 80e224e8edcc6dace9bb47163e10fbc3eb88025e (patch) | |
| tree | fb317b184401c8780c75f898ad03d9429fe74d5f /webserver.py | |
| parent | 75fadd788a22e9fada10dd99ea4e63730b650d64 (diff) | |
| download | ZeroMQ_Video_Streaming-80e224e8edcc6dace9bb47163e10fbc3eb88025e.tar.gz ZeroMQ_Video_Streaming-80e224e8edcc6dace9bb47163e10fbc3eb88025e.tar.bz2 ZeroMQ_Video_Streaming-80e224e8edcc6dace9bb47163e10fbc3eb88025e.zip | |
Add support for zmq certificates
Diffstat (limited to 'webserver.py')
| -rw-r--r-- | webserver.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/webserver.py b/webserver.py index a2b9b7a..4c45692 100644 --- a/webserver.py +++ b/webserver.py @@ -30,6 +30,7 @@ from helpers import ( CustomLoggingFormatter, DIRECTIVES, MAX_CAMERA_NAME_LENGTH, + auth_service, ) @@ -49,6 +50,7 @@ WEB_PORT = "8008" CTRL_BACKEND_ADDR = f"tcp://{HOST}:{ZMQ_PORT}" WEB_BACKEND_ADDR = f"tcp://{HOST}:{WEB_PORT}" TIME_FORMAT = '%Y_%m_%d-%H_%M_%S' +CERTIFICATE_DIR = 'certs' log_formatter = CustomLoggingFormatter() handler = logging.FileHandler(LOGFILE, encoding='utf-8', mode='a') @@ -68,6 +70,9 @@ ws_queues = defaultdict(dict) ctrl_msg_que = asyncio.Queue() # Create ZMQ context and socket: zmq_context = zmq.asyncio.Context() +# Authenticate context: +auth_service(zmq_context, CERTIFICATE_DIR) + zmq_socket = zmq_context.socket(zmq.DEALER) # Connect to ZMQ backend: zmq_socket.connect(WEB_BACKEND_ADDR) |
