API Reference
Available Endpoints
Xray Checker provides several HTTP endpoints for monitoring and status checking:
Health Check Endpoint
Simple health check endpoint that returns HTTP 200 if the service is running.
Response:
- Status:
200 OK
- Body:
OK
Metrics Endpoint
Prometheus metrics endpoint providing detailed proxy status and latency information.
Response:
- Status:
200 OK
- Content-Type:
text/plain; version=0.0.4
Example metrics:
Proxy Status Endpoint
Individual proxy status endpoint, perfect for uptime monitoring.
Parameters:
index
: Proxy index numberprotocol
: Protocol type (vless/vmess/trojan/shadowsocks)server
: Server addressport
: Server port
Response:
- Status:
200 OK
if proxy is working - Status:
503 Service Unavailable
if proxy is not working - Body:
OK
orFailed
Example:
Web Interface
Returns the HTML dashboard with proxy status overview.
Authentication
When enabled (METRICS_PROTECTED=true
), endpoints are protected with Basic Authentication:
- Username: Configured via
METRICS_USERNAME
- Password: Configured via
METRICS_PASSWORD
Example with authentication:
Integration Examples
Uptime Kuma
Prometheus
Error Responses
The API returns standard HTTP status codes:
200 OK
: Request successful401 Unauthorized
: Authentication required403 Forbidden
: Authentication failed404 Not Found
: Endpoint or proxy not found503 Service Unavailable
: Proxy check failed