How to Use Mobile Proxies with curl
curl is the fastest way to test a line. One command sends a request through the proxy and prints the address that the server sees, and the same flags work in shell scripts and cron jobs.
What do I need before I start?
| Host | gw.mobileproxy.live |
|---|---|
| HTTP and HTTPS port | 9000 |
| SOCKS5 port | 9100 |
| Username | mp4x9q2.mobile.us.sid-a1b2.rot-10 |
| Password | YOUR_PASSWORD (your own line password) |
- curl 7.x or newer, included in Windows 10 and later, macOS and most Linux systems
- Your username and password in your account under My lines. The username above is an example, and each part is explained in the username reference.
How do I set it up?
- Open a terminal. On Windows, use PowerShell and type curl.exe so the real program runs.
- Copy the HTTP command below and replace YOUR_PASSWORD with your password.
- Run it. The answer is JSON with the IP, city and country of your line.
- To use SOCKS5, run the second command that uses the SOCKS5 port.
- Add a country, city or session id to the username to test other settings.
- Use the same flags in your scripts, and add --max-time so a slow request cannot hang.
What does the code look like?
curl -x http://gw.mobileproxy.live:9000 -U "mp4x9q2.mobile.us.sid-a1b2.rot-10:YOUR_PASSWORD" https://ipinfo.io/jsoncurl --proxy socks5h://gw.mobileproxy.live:9100 -U "mp4x9q2.mobile.us.sid-a1b2.rot-10:YOUR_PASSWORD" https://ipinfo.io/jsonHow do I check my IP?
The command prints the JSON of https://ipinfo.io/json. Check ip and country, and run the same command without the proxy flags to compare with your own address.
https://ipinfo.io/json
On a mobile line you can ask for a fresh address at any time with your change-IP link, for example https://gw.mobileproxy.live/rotate/k7Qm2xV9. The real link for each line is in your account.
What if it does not work?
407 Proxy Authentication Required.
The username or password is wrong. Wrap the login in double quotes so the shell does not change special characters.
Could not resolve proxy.
Check the spelling of the host and your own internet connection, then run the command again.
Works in one shell, not another.
In PowerShell use curl.exe, because curl is an alias for another command there.
Frequently asked questions
What does the h in socks5h mean?
It makes the proxy resolve the hostname instead of your computer, which keeps DNS lookups on the proxy side.
Can I request a new IP with curl?
Yes. Request your change IP link from your account with curl, then run the check again.
Can I save the proxy for all curl commands?
Set the https_proxy environment variable, or add the proxy to a curl config file, so you do not type the flags each time.
Related guides
Need a line to connect?
Create an account, top up your balance and your first line is ready to use with curl.