aboutsummaryrefslogtreecommitdiff
path: root/webserver.py
diff options
context:
space:
mode:
Diffstat (limited to 'webserver.py')
-rw-r--r--webserver.py5
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)