2篇 curl related articles

curl ipv6

curl with ipv6 sample code:

# interface 'eth0' is the interface with ipv6 enabled
curl -g -6 'http://[fe80::3ad1:35ff:fe08:cd%eth0]:80/'
curl -g -6 'http://[fe80::3ad1:35ff:fe08:cd]'

# https without ssl validate
curl -g -k -6 'https://[fe80::3ad1:35ff:fe08:cd]'
More ~

curl 使用 proxy (http_proxy, https_proxy)

第一种方法:定义环境变量

//无需用户名和密码
export http_proxy=http://ip:port
export https_proxy=http://ip:port

//需要用户名和密码
export http_proxy=http://user:password@ip:port
export https_proxy=https://user:password@ip:port

第二种方法:在执行curl时加参数-x

curl -x <[protocol://][user:password@]proxyhost[:port]> url
--proxy <[protocol://][user:password@]proxyhost[:port]> url
--proxy http://user:password@Your-Ip-Here:Port url
-x http://user:password@Your-Ip-Here:Port url


curl -x http://mike:123456@api.baidu.com:3392 https://www.zixi.org

More ~