curl
Route HTTP requests through Rayley's static IP proxy using curl.
curl supports proxies through the --proxy flag. This works for quick tests, scripts, and CI pipelines.
Prerequisites
- A Rayley account with a Proxy Token (
rpt_*). Create one in the dashboard.
Quick start
curl --proxy "https://token:rpt_your_token_here@proxy.rayley.com" \
https://api.example.com/dataYour request to api.example.com now routes through Rayley and originates from your assigned static IP.
Shell script example
#!/usr/bin/env bash
set -euo pipefail
token="${RAYLEY_TOKEN:?Set RAYLEY_TOKEN to your Proxy Token}"
url="${1:-"https://example.com"}"
body="$(curl --proxy "https://token:${token}@proxy.rayley.com" "$url"))"
echo "$body"Run it:
chmod +x ./proxy-request.sh
RAYLEY_TOKEN=rpt_your_token bash ./proxy-request.sh https://httpbin.org/getAuthentication
The proxy URL embeds the token as basic auth credentials. The username is the literal string token and the password is your Proxy Token:
https://token:<your-proxy-token>@proxy.rayley.comYou can also set the Proxy-Authorization header with the value Bearer <your-proxy-token> and use the proxy URL without credentials:
curl --proxy "https://proxy.rayley.com" \
-H "Proxy-Authorization: Bearer rpt_your_token_here" \
https://api.example.com/data