我有这个代理地址:125.119.175.48:8909

如何使用cURL(如cURL http://www.example.com)执行HTTP请求,但指定我的网络的代理地址?


当前回答

注意,如果你正在使用SOCKS代理,而不是HTTP/HTTPS代理,你将需要使用——socks5开关:

curl --socks5 125.119.175.48:8909 http://example.com/

还可以使用——socks5-hostname代替——socks5在代理端解析DNS。

其他回答

来自man curl:

-x, --proxy <[protocol://][user:password@]proxyhost[:port]>

     Use the specified HTTP proxy. 
     If the port number is not specified, it is assumed at port 1080.

我喜欢用这个来获得我被看到的IP

curl -x http://proxy_server:proxy_port https://api.ipify.org?format=json && echo

希望这能帮助到一些人。

旋度vv -ksL“https://example.com”- x " http:// <代理>:< >港”

curl -x socks5://username:password@ip:port example.com

注意,如果你正在使用SOCKS代理,而不是HTTP/HTTPS代理,你将需要使用——socks5开关:

curl --socks5 125.119.175.48:8909 http://example.com/

还可以使用——socks5-hostname代替——socks5在代理端解析DNS。