foxcloud

FoxCloud API Documentation

This document describes the API endpoints provided by FoxCloud.

Base URL

All endpoints are relative to your deployed Worker URL:

https://your-worker.your-subdomain.workers.dev

Public Endpoints

GET /

Returns the main landing page with system status information.

Response:

GET /sub

Returns the subscription configuration page for VLESS clients.

Response:

GET /{uuid}

Returns VLESS configuration for a specific UUID.

Path Parameters:

Response:

Example:

GET /08dad8a6-8a6c-4424-9d63-62f3a9bf7f4f

Response:
vless://08dad8a6-8a6c-4424-9d63-62f3a9bf7f4f@your-domain.workers.dev:443?encryption=none&security=tls&sni=your-domain.workers.dev&fp=chrome&type=ws&host=your-domain.workers.dev&path=/ws

WebSocket Endpoint

GET /ws

Upgrades HTTP connection to WebSocket for proxy traffic.

Query Parameters:

Headers:

Response:

WebSocket Communication:

Error Responses

404 Not Found

Returned when accessing an unknown endpoint.

Response:

500 Internal Server Error

Returned when an unexpected error occurs.

Response:

400 Bad Request

Returned when request parameters are invalid.

Response:

Rate Limiting

FoxCloud inherits rate limiting from Cloudflare Workers:

Exceeding these limits may result in:

Security Considerations

Authentication

Encryption

Access Control

CORS Policy

FoxCloud does not implement CORS headers as it’s primarily designed for proxy traffic rather than web API usage.

Content Types

HTML Pages

Plain Text

Binary Data

WebSocket Protocol

Connection Flow

  1. Client connects to /ws endpoint with Upgrade header
  2. Server validates request and upgrades to WebSocket
  3. Client sends VLESS handshake
  4. Server connects to configured proxy server
  5. Bidirectional data transfer begins

Data Format

Connection Lifecycle

Environment Variable Endpoints

Environment variables are not directly accessible via HTTP endpoints for security reasons. They are only available within the Worker runtime.

Health Check Endpoint

Currently, there is no dedicated health check endpoint. The main page (/) can be used as a basic health check.

Version Information

Version information is displayed on the main page and in the subscription page footer.

Customization

The API endpoints are fixed and cannot be customized without modifying the source code. The following aspects can be customized through environment variables:

Integration Examples

Client Integration

Clients integrate by:

  1. Obtaining VLESS configuration from /sub or /{uuid} endpoint
  2. Connecting to WebSocket endpoint /ws
  3. Sending VLESS handshake
  4. Transferring data through the proxy

Monitoring Integration

Monitoring can be implemented by:

  1. Making periodic requests to / endpoint
  2. Checking response status codes
  3. Parsing response content for status information

API Evolution

As FoxCloud evolves, endpoints may be added or modified. Breaking changes will be documented in the changelog and version releases.

Debugging

For debugging API issues:

  1. Check Cloudflare Worker logs
  2. Verify environment variables are set correctly
  3. Test endpoints with curl or browser
  4. Monitor response headers and status codes

Example Usage

Getting Subscription Configuration

curl https://your-worker.your-subdomain.workers.dev/sub

Getting VLESS Configuration for UUID

curl https://your-worker.your-subdomain.workers.dev/08dad8a6-8a6c-4424-9d63-62f3a9bf7f4f

Testing WebSocket Connection

WebSocket connections require a proper VLESS client implementation and cannot be easily tested with command-line tools.

This API documentation provides a complete reference for integrating with and using FoxCloud.