Integration · cURL
Use RoProxy with cURL
cURL is the quickest way to check that a RoProxy session works before you wire it into code. A session gives you a username, a password, a gateway host and an HTTP port, plus a SOCKS5 port on the Pro and Business plans. The commands below use them over HTTP and SOCKS5, set them once through environment variables so other command-line tools pick them up, and call the RoProxy API to rotate the IP or list your sessions with an API key.
Test a session
Each command prints the IP the website sees. HTTPS goes through the HTTP port with a CONNECT tunnel. The SOCKS5 command needs a Pro or Business session.
curl -x http://USERNAME:PASSWORD@GATEWAY_HOST:HTTP_PORT https://api.ipify.orgSet it once with environment variables
cURL, wget, pip, git and many other tools read these variables, so a whole shell session can go through one RoProxy session.
export HTTPS_PROXY="http://USERNAME:PASSWORD@GATEWAY_HOST:HTTP_PORT"
export HTTP_PROXY="$HTTPS_PROXY"
curl https://api.ipify.orgRotate and list sessions with the API
Create an API key in the dashboard. Free and Standard sessions have a short cooldown between manual rotations; calling earlier returns 429.
# A new IP for one session
curl -X POST -H "Authorization: Bearer API_KEY" \
https://backend-api.ro-proxy.com/api/session/SESSION_ID/rotate
# Your sessions with their gateway, ports, strategy and current IP
curl -H "Authorization: Bearer API_KEY" \
"https://backend-api.ro-proxy.com/api/session?size=20"Reading the errors
CONNECT tunnel failed, response 407
The proxy refused the credentials: a wrong username or password, or an expired session.
Failed to connect (exit code 7)
Wrong gateway host or port. Use the session's own values; the HTTP and SOCKS5 ports differ.
Anything unclear
Add -v: cURL prints the CONNECT request and the proxy's status line before the website's response.
Frequently asked questions
Why does PowerShell ignore my proxy flags?
In Windows PowerShell, curl is an alias for Invoke-WebRequest. Call curl.exe to run the real cURL with the same flags.
What is the difference between --socks5 and --socks5-hostname?
--socks5-hostname lets the proxy resolve the domain name, so the DNS lookup does not leave from your machine; --socks5 resolves it locally.
How do I see why a proxy request fails?
Add -v. cURL prints the CONNECT request and the proxy's status code, such as 407 for wrong credentials, before anything from the website.