给命令行设置代理

最近在搞Flutter。我觉得整体还是不太成熟,表现之一就是在Android Studio里面编译运行的时候不能设置代理。Android开发的话,直接给gradle设置代理就行了,然而Flutter不支持直接设置代理,至少我没找到方法。那么在国内这种特色网络环境下,我又不喜欢用镜像仓库,怎么做Flutter开发呢?

用命令行编译,然后给命令行设置代理。

下面记录一下给命令行设置代理的方法

Windows

1
2
3
4
5
6
7
8
9
10
11
set http_proxy=http://127.0.0.1:1081
set https_proxy=http://127.0.0.1:1081

set http_proxy_user=user
set http_proxy_pass=pass

set https_proxy_user=user
set https_proxy_pass=pass

set http_proxy=
set https_proxy=

Linux

1
2
3
4
5
export ALL_PROXY="socks5://192.168.99.110:1080"
export all_proxy="socks5://192.168.99.110:1080"

unset ALL_PROXY
unset all_proxy
使用搜索:谷歌必应