Endpoint
Request
No parameters required. This is a simple GET request.Request Examples
Response
Success Response (200 OK)
The endpoint always returns a 200 OK status, even when the ICE server is disconnected. Check theconnected field to determine the actual connection state.
Indicates whether the Flask server has an active connection to the ICE server.
true: ICE server is connected and API operations will workfalse: ICE server is disconnected and API operations will fail with 503 errors
The address and port of the ICE server that the Flask app attempts to connect to.Default value:
"localhost:10000"Response Examples
Implementation Details
The connection status is determined by checking if the
cliente.proxy object is initialized (web_server.py:161). The proxy is set during the initial connection attempt when the Flask server starts.Connection Flow
-
Server Startup: When the Flask server starts (web_server.py:191), it attempts to connect to the ICE server:
-
Status Check: The
/api/statusendpoint checks ifcliente.proxyis notNone: - Result: Returns the connection state and server address
Use Cases
Health Check Endpoint
Use this endpoint for monitoring and alerting:UI Connection Indicator
Display connection status in your frontend:Graceful Error Handling
Check status before attempting conversions:Container Orchestration Health Checks
Use in Docker Compose or Kubernetes:docker-compose.yml
kubernetes-deployment.yaml
Troubleshooting
Starting the ICE Server
If the status shows disconnected:Reconnection Behavior
The Flask server only attempts to connect to the ICE server once at startup. If the connection fails or is lost, you must restart the Flask server to reconnect.
Common Issues
Connection shows false immediately after startup
Connection shows false immediately after startup
Cause: The ICE server is not running or is not listening on port 10000.Solution:
- Start the ICE server with
python3 server.py - Verify it’s running with
lsof -i :10000ornetstat -an | grep 10000 - Restart the Flask server
Status endpoint returns 200 but conversions fail
Status endpoint returns 200 but conversions fail
Cause: The proxy was initialized but the connection was lost.Solution: Restart both servers:
Port 10000 is already in use
Port 10000 is already in use
Cause: Another instance of the ICE server is running or the port is occupied.Solution:
Related Endpoints
API Overview
Learn about error handling when disconnected
Convert Units
Requires active connection to ICE server