When DENCHCLAW_DAEMONLESS=1, route the terminal WebSocket through
the app host instead of connecting directly to 127.0.0.1, allowing
it to work in environments without direct port access.
- Refactor WebSocket connection logic to dynamically fetch the port from the server, improving flexibility.
- Introduce global variables to manage WebSocket server state and port, allowing for better control and error handling.
- Update terminal drawer component to use the new port fetching mechanism, ensuring consistent connection behavior.