为Linux/Windows命令行设置网络代理

# Linux 设置代理
export {http,https}_proxy=http://127.0.0.1:1080
# Linux 取消代理
export {http,https}_proxy=

# Windows 设置代理 
set http_proxy=http://127.0.0.1:1080
set https_proxy=http://127.0.0.1:1080 
# Windows 取消代理
set http_proxy=
set https_proxy=

为curl指定域名解析IP

示例:
将 http://example.com 或 https://example.com 请求指定域名解析的IP为127.0.0.1

curl --resolve example.com:80:127.0.0.1 http://example.com/
curl --resolve example.com:443:127.0.0.1 https://example.com/