×

Curl测试socks5 与 http 代理命令

2024-04-07 10:14:11 Falcon

测试Socks5代理

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

测试http命令:

curl --connect-timeout 2 -x 127.0.0.1:8118 http://google.com

linux curl命令可以使用下面参数设置http(s)代理、socks代理,已经设置它们的用户名、密码以及认证方式:

 

参数 用法
-x host:port
-x [protocol://[user:pwd@]host[:port]
--proxy [protocol://[user:pwd@]host[:port]
使用HTTP代理访问;如果未指定端口,默认使用8080端口;
protocol默认为http_proxy,其他可能的值包括:
http_proxy、HTTPS_PROXY、socks4、socks4a、socks5;
如:
--proxy 8.8.8.8:8080;
-x "http_proxy://aiezu:123@aiezu.com:80"
--socks4 <host[:port]>
--socks4a <host[:port]>
--socks5 <host[:port]>
使用SOCKS4代理;
使用SOCKS4A代理;
使用SOCKS5代理;
此参数会覆盖“-x”参数;
--proxy-anyauth
--proxy-basic
--proxy-diges
--proxy-negotiate
--proxy-ntlm
代理认证方式,参考:
--anyauth
--basic
--diges
--negotiate
--ntlm
-U <user:password>
--proxy-user <user:password>
设置代理的用户名和密码;
本文收录于