2.6 KiB
2.6 KiB
CDN Surfer - Deployment Guide
A high-performance proxy leveraging Cloudflare's global edge network for accelerated web browsing.
CDN Surfer - Surf the web at CDN speeds! 🌐
Quick Start
1. Deploy to Cloudflare
npx wrangler deploy
That's it! Your edge proxy is now live.
Configuration
KV Namespaces
The proxy requires two KV namespaces:
- PROXY_KEYS - Stores valid API keys
- PROXY_COOKIES - Stores session cookies per IP/domain
Update wrangler.toml with your KV namespace IDs:
[[kv_namespaces]]
binding = "PROXY_KEYS"
id = "your-keys-namespace-id"
[[kv_namespaces]]
binding = "PROXY_COOKIES"
id = "your-cookies-namespace-id"
API Keys
Add API keys to the PROXY_KEYS KV namespace:
npx wrangler kv:key put --namespace-id YOUR_KEYS_ID "pk_yourkey123" "valid"
The default test key is: pk_test12345678901234567890123456789012
Usage
Example Usage
# Access dashboard with API key
https://your-worker-url.workers.dev/?api_key=YOUR_API_KEY
# Proxy a URL
curl "https://your-worker-url.workers.dev/?fetch=https://example.com&api_key=YOUR_API_KEY"
Features
- ⚡ Edge Acceleration - Leverages Cloudflare's global CDN
- 🔄 Complete URL Rewriting - All resources route through edge
- 🎯 Browser Consistency - Standardized fingerprints across clients
- 🍪 Session Management - Cookie handling with KV storage
- 🚀 Performance Optimized - Efficient content delivery
Configuration Options
Edit src/index.js to customize:
const CONFIG = {
BLOCKED_REQ: new Set([...]), // Headers to remove from requests
BLOCKED_RES: new Set([...]), // Headers to remove from responses
MAX_SIZE: 10485760 // Max response size (10MB)
};
Monitoring
Check deployment status:
npx wrangler tail
View logs in Cloudflare Dashboard → Workers → Your Worker → Logs
Troubleshooting
401 Authentication Error
- Ensure
api_keyquery parameter is included - Verify API key exists in PROXY_KEYS KV namespace
Content Not Loading
- Check that URLs are properly encoded
- Verify KV namespaces are configured correctly
Rate Limiting
- Adjust limits in CONFIG object if needed
Production Checklist
- Update KV namespace IDs in wrangler.toml
- Add production API keys to PROXY_KEYS
- Test with target websites
- Configure appropriate rate limits
- Set up monitoring and alerts
- Review Cloudflare Worker limits for your plan
Support
For issues or questions, check the Cloudflare Workers documentation or open an issue.