Environment Variables Configuration
FoxCloud requires specific environment variables to function properly. This guide explains each variable and how to configure them.
Required Variables
UUID
The UUID variable contains one or more user identifiers for VLESS authentication.
Format: Single UUID or comma-separated list of UUIDs
Example:
UUID = "08dad8a6-8a6c-4424-9d63-62f3a9bf7f4f"
or
UUID = "08dad8a6-8a6c-4424-9d63-62f3a9bf7f4f,49d598ee-4dfc-4001-95ca-99a5b6002e3c"
Generation: Use a UUID generator to create secure identifiers:
- Linux:
cat /proc/sys/kernel/random/uuid
- macOS:
uuidgen
- Windows PowerShell:
New-Guid
- Online: UUID Generator
PROXY_IP
The PROXY_IP variable contains one or more proxy server addresses.
Format: Single IP:port or comma-separated list of IP:port combinations
Example:
PROXY_IP = "172.66.45.9:443"
or
PROXY_IP = "172.66.45.9:443,104.18.128.25:443,162.159.136.94:443"
Setting Environment Variables
Method 1: Wrangler CLI (Recommended)
wrangler secret put UUID
# Enter your UUID when prompted
wrangler secret put PROXY_IP
# Enter your proxy IP(s) when prompted
Method 2: wrangler.toml
Add to your wrangler.toml
:
[vars]
UUID = "your-uuid-here"
PROXY_IP = "proxy-ip:port"
Method 3: Cloudflare Dashboard
- Go to your Worker in Cloudflare Dashboard
- Navigate to “Settings” → “Variables”
- Add variables under “Environment Variables”
Security Best Practices
- Use Wrangler Secrets: For production, always use
wrangler secret put
rather than storing secrets in wrangler.toml
- Generate Secure UUIDs: Use version 4 UUIDs for cryptographic security
- Limit Access: Only provide UUIDs to trusted users
- Regular Rotation: Rotate UUIDs periodically for enhanced security
- Validate IPs: Ensure proxy IPs are valid and accessible
Troubleshooting
Variable Not Set
If you see errors about missing variables:
- Verify variables are set using one of the methods above
- Check that variable names match exactly (case-sensitive)
- Redeploy your Worker after setting variables
If connections fail:
- Verify UUIDs are in the correct format (8-4-4-4-12 hexadecimal)
- Ensure no extra spaces or characters
- Check that UUIDs are properly comma-separated for multiple values
Proxy Connection Issues
If proxy connections fail:
- Verify proxy IPs are accessible from the internet
- Check that ports are open and correctly specified
- Ensure proxy servers support WebSocket connections
- Test each proxy IP individually to identify issues