1 git

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

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

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

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

2 Python

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

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

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

3 Cargo

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

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


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

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

4 Flutter

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

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

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

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

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

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

5 Android Studio Gradle

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

systemProp.https.proxyHost=127.0.0.1
systemProp.https.proxyPort=1083

6 hg

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

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

7 npm

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

8 其他

使用系统httpclient的和flutter相同。