A proxy server that handles API requests through a configured proxy service.
# Install dependencies
bun install
# Development
bun run dev
# Run tests
bun test
# Deploy
npm run deploy
Copy .env.example
to .env
and fill in the following parameters:
PROXY_CUSTOMER=your_customer_id # Your proxy service customer ID
PROXY_SESSION_ID=your_session_id # Session ID for proxy authentication
PROXY_PASSWORD=your_password # Password for proxy authentication
PROXY_HOST=proxy.example.com # Proxy server hostname
PROXY_PORT=1234 # Proxy server port number
GET /
Response: { "message": "Hello, World!" }
GET /proxy?apiUrl=<target-api-url>
https://your-domain.com/proxy?apiUrl=https://api.example.com/data
fetch('https://your-domain.com/proxy?apiUrl=https://api.example.com/data', {
headers: {
'x-custom-header': 'value'
}
})
- Proxies HTTP/HTTPS requests through a configured proxy server
- Dynamic session ID generation for each request
- Supports custom headers
- Automatic JSON response parsing
- Comprehensive error handling
- 400: Missing API URL parameter
- 500: Invalid JSON response
- 500: Request failed
- 500: Proxy request failed
- The
apiUrl
parameter must be URL encoded - All responses are automatically parsed as JSON
- SSL certificate verification is handled by the proxy