
Teach you how to use curl to hang a proxy!
Web developers should have encountered this situation: local requests always timeout, or some sites can not be accessed. This time we have to call out the proxy IP this savior. Let's talk about how to use the curl command line to hang the proxy, I am sure to see the end of the operation can get started.
HTTP proxy configuration
Let's get one ready.ipipgoof the HTTP proxy in a format that looks like this: http://用户名:密码@gateway address:port. As an example:
curl -x "http://user2024:pass123@gateway.ipipgo.com:8899" https://target-site.com
Three things to note here:
1. The user name, password, and gateway address are separated by the@ symbolgrout
2. Proxy agreement must be written clearly whether http or https
3. When you encounter a proxy that requires authentication, remember to fill in the account password in front of the gateway address.
SOCKS5 Agent Hands-on
The SOCKS5 proxy is more appropriate when you need to handle UDP protocols or more complex network requests. Use theipipgoRemember to add the -socks5 parameter to the SOCKS5 proxy:
curl --socks5 "user2024:pass123@gateway.ipipgo.com:1080" https://target-api.com
Here's a pitfall to be aware of: the SOCKS5 agent'sport numberUnlike HTTP proxies, common SOCKS5 ports are 1080 or 1081, depending on the parameters given by the service provider.
Proxy Environment Variable Configuration
If you want to save time, you can set up system variables so that you don't have to type commands with parameters every time. Open a terminal and type:
export http_proxy="http://user2024:pass123@gateway.ipipgo.com:8899"
export https_proxy=$http_proxy
After setting it up remember to check if it takes effect with this command:
curl -v https://ipinfo.io/ip
Common Rollover Scene QA
Q: The proxy configuration is successful but the request is not responding?
A: Use telnet to test the port first:telnet gateway.ipipgo.com 8899. If it doesn't connect, it could be a fire problem or an expired proxy.
Q: How can I check if the current request is going through a proxy?
A: In the curl command add-vparameter, look at the return message in theConnected toThe back is not a proxy server address.
Q: What if I need both http and socks5 proxy?
A: In this case it is recommended to useipipgoThe intelligent routing agent, their gateway can automatically recognize the protocol type, the configuration method see the official document.
The doorway to choosing a proxy service
A final note to newcomers, there are three things to look for when choosing an agency service:
1. Connection stability (ipipgo(With 99.9% online rate guarantee)
2. Comprehensiveness of proxy agreement support
3. Availability of real-time monitoring interface
If you're too lazy to do it yourself, just useipipgoThe ready-made agent program is the most hassle-free. They support pay-per-volume, and new users can also whore out test credits, so go to the official website and take a look to know how to operate.

