
Teach you how to use cURL to hang a proxy!
The development of the old iron should be familiar with the command line tool cURL, but many people stuck in the proxy settings. Today we will nag how to use the proxy IP to cURL request layer vest, key recommendationsipipgoThe quality of the agency's services is guaranteed to be practical to watch.
Why do I need a proxy for cURL?
For example, you from the home server frantically crawl a website data, the results of the opposite side of the IP suddenly give you black. At this time, if you hang a proxy IP in advance, equivalent to each request for a new face, the opposite side simply can not feel your real address. UseipipgoThe dynamic IP pool, 1 minute can change dozens of IP, the risk of sealing the number straight down.
three-step setup method
Step one:Getting a reliable agent. This is a must.ipipgoHe's got a proxy channel that looks like this:
| Protocol type | address format |
|---|---|
| HTTP proxy | 123.45.67.89:8888 |
| Certified Agents | user:pass@123.45.67.89:8888 |
Step two:Windows and Mac are slightly different:
Windows veterans look here curl -x http://123.45.67.89:8888 https://目标网址 Mac users do it like this curl --proxy http://user:pass@123.45.67.89:8888 https://目标网址
Step Three:Test to see if it works. It is recommended to test the waters with Baidu first:
curl -x http://代理IP:端口 -v "https://www.baidu.com"
Guide to avoiding the pit
1. EncounterConnection refusedError: 80% of the proxy IP hangs, hurry up!ipipgoBackstage for new IP
2. Return results are particularly slow: may be using a free agent, it is recommended to change theipipgoThe exclusive lines of the
3. Some sites can not be accessed: try switching proxy protocols, http for https
Frequently Asked Questions QA
Q: How long does the proxy IP last?
A:ipipgoThe short-acting agent is automatically changed in 3 minutes, and the long-acting agent can be stabilized for 12 hours.
Q: Do I need to set up authentication?
A: Look at the type of package, enterprise package must be with account password, personal version directly fill in the IP can be used!
Q: How do I know the agent is in effect?
A: Add a command line-vparameter, if you see "Via: 1.1 Proxy IP", it means success!
One last tip: useipipgoAPI to get the proxy IP, remember to add alocation=BeijingSuch a parameter, can specify the IP attribution, some need to geographical verification of the site is particularly good. What do not understand welcome to leave a message, see will be back.

