控制台设置代理

  • Windows cmd
  • Windows powershell
  • Linux bash

Windows cmd

set HTTP_PROXY=http://127.0.0.1:7890
set HTTPS_PROXY=http://127.0.0.1:7890

Window powershell

$env:HTTP_PROXY="http://127.0.0.1:7890"
$env:HTTPS_PROXY="http://127.0.0.1:7890"

bash

export http_proxy=http://127.0.0.1:7890
export https_proxy=http://127.0.0.1:7890

或使用proxychains。Gentoo 下使用emerge --ask net-proxy/proxychains进行安装

然后编辑配置文件/etc/proxychains.conf

[ProxyList]
# add proxy here ...
# meanwile
# defaults set to "tor"
# socks4  127.0.0.1 9050
http    127.0.0.1 7890
socks5  127.0.0.1 7891

验证

curl ifconfig.co/json

输出:

{
  "ip": "193.32.126.236",
  "ip_decimal": 3240132332,
  "country": "France",
  "country_iso": "FR",
  "country_eu": true,
  "region_name": "Île-de-France",
  "region_code": "IDF",
  "zip_code": "75001",
  "city": "Paris",
  "latitude": 48.8323,
  "longitude": 2.4075,
  "time_zone": "Europe/Paris",
  "asn": "AS39351",
  "asn_org": "31173 Services AB",
  "user_agent": {
    "product": "Mozilla",
    "version": "5.0",
    "comment": "(Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0",
    "raw_value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0"
  }
}

可以看到区域变成了法国,设置成功


comment: