1 git

github的repo拖不下来可以参考:

[http]
  proxy = "socks5://127.0.0.1:1091"
  sslVerify = false
  postBuffer = 524288000
  lowSpeedLimit = 0
  lowSpeedTime = 999999
  
[https]
  proxy = "socks5://127.0.0.1:1091"
  sslVerify = false
  postBuffer = 524288000
  lowSpeedLimit = 0
  lowSpeedTime = 999999

[core]
  symlinks = true
  gitProxy = 'socks5://127.0.0.1:1091'

修改到~/.gitconfig文件中作为全局配置。

2 Python

Python的urllib可以自动使用环境变量指定的proxy,设置如下:

import os
os.environ['HTTP_PROXY'] = '127.0.0.1:1093'
os.environ['HTTPS_PROXY'] = '127.0.0.1:1093'

注意需要增加到urllib的import之前。

另外,对于pip安装工具的代理设置,如果使用socks5,需要安装pysock

pip install pysocks

然后在使用pip时添加参数:

pip install --proxy='socks5://127.0.0.1:1091' numpy

3 Cargo

Cargo是Rust的包管理工具,需要修改cargo的配置文件:

[http]
  proxy = "socks5://127.0.0.1:1091"


[https]
  proxy = "socks5://127.0.0.1:1091"

改全局的话改~/.cargo/config文件。改当前项目可以改$ProjRoot/.cargo/config文件,不存在可以新创建。

4 Flutter

Flutter可以修改$FlutterRoot/bin/flutter.bat|flutter,增加到第一行:

REM for windows
set https_proxy=socks5://127.0.0.1:1091

# for *nix
export https_proxy="socks5://127.0.0.1:1091"

由于flutter用的是dart的基础设施,所以也可以改$FlutterRoot/bin/cache/dart-sdk/pub.bat|pub,也是增加到第一行:

REM for windows
set https_proxy=socks5://127.0.0.1:1091

# for *nix
export https_proxy="socks5://127.0.0.1:1091"

5 Android Studio Gradle

找到$PROJ/gradle.properties文件,
增加如下配置:

systemProp.https.proxyHost=127.0.0.1
systemProp.https.proxyPort=1093

6 hg

[http_proxy]
host=127.0.0.1:1093
user=username
passwd=password

~/.hgrc for *nix, ~/mercurial.ini for windows

7 npm

npm config set proxy http://127.0.0.1:1093
npm config set https-proxy http://127.0.0.1:1093

8 其他

使用系统httpclient的和flutter相同。