Add CONTROL_SERVER_HOST to allow external connections
- Add CONTROL_SERVER_HOST environment variable (default: 0.0.0.0) - Server now binds to all interfaces by default for external access - Update .env and .env.example with new host configuration - Allows UI clients to connect from other machines on the network
This commit is contained in:
@@ -376,10 +376,11 @@ class ControlServer:
|
||||
|
||||
async def start_websocket_server(self):
|
||||
"""Start WebSocket server for UI clients."""
|
||||
host = os.getenv("CONTROL_SERVER_HOST", "0.0.0.0")
|
||||
server = await websockets.serve(
|
||||
self.handle_ui_client, "localhost", CONTROL_SERVER_PORT
|
||||
self.handle_ui_client, host, CONTROL_SERVER_PORT
|
||||
)
|
||||
logging.info(f"WebSocket server listening on localhost:{CONTROL_SERVER_PORT}")
|
||||
logging.info(f"WebSocket server listening on {host}:{CONTROL_SERVER_PORT}")
|
||||
|
||||
async def run(self):
|
||||
"""Run the control server."""
|
||||
|
Reference in New Issue
Block a user