How to Use Proxies with cURL
cURL is the fastest way to check that your proxy login works and to see which IP and country you get.
Steps
- Copy your username and password from the console
- Run curl with -x for the proxy and -U for the login
- Check the IP and country in the answer
- Change the username to switch country or session
Example code
# rotating, any country
curl -x http://gw.gbproxies.cc:10000 -U "USERNAME:PASSWORD" https://api.ipify.org
# Germany, same IP for 30 minutes
curl -x http://gw.gbproxies.cc:10000 -U "USERNAME-cc-de-sid-test1-ttl-30:PASSWORD" https://api.ipify.org
# SOCKS5
curl -x socks5h://gw.gbproxies.cc:10001 -U "USERNAME:PASSWORD" https://api.ipify.orgReplace USERNAME and PASSWORD with the proxy login from the Proxies page of the console. Port 10000 is residential HTTP; see the ports of every product below.
Tips
- socks5h resolves the target name on the proxy side
- Add -v to see the CONNECT step and the status code
Common questions
What does 407 mean?
The login was not accepted: check the username, password and remaining GB for that product.