bazel 支持代理設置, 參數中不能設置, 可以設置環境變量HTTPS_PROXY
注意大小寫
Using Proxies
Bazel will pick up proxy addresses from the HTTPS_PROXY and HTTP_PROXY environment variables and use these to download HTTP/HTTPS files (if specified).
powershell
PowerShell - CMD 設置HTTPHTTPS代理
$env:HTTPS_PROXY="http://127.0.0.1:1080"
$env:HTTP_PROXY="http://127.0.0.1:1080"
$env:all_proxy="socks5://127.0.0.1:1081"
cmd
set http_proxy=http://127.0.0.1:1080
set https_proxy=http://127.0.0.1:1080
linux bash
export HTTPS_PROXY="http://192.168.56.1:1080"
export HTTP_PROXY="http://192.168.56.1:1080"
注意
關閉窗口后, 再打開新窗口需要重新設置環境變量
移除
remove-item env:HTTPS_PROXY
bazel --host_jvm_args "-DsocksProxyHost=192.168.56.1 -DsocksProxyPort=1080" run --define MEDIAPIPE_DISABLE_GPU=1 --action_env PYTHON_BIN_PATH=/usr/bin/btpython mediapipe/examples/desktop/hello_world
使用socks5 Dsocks5ProxyHost
--host_jvm_args "-Dsocks5ProxyHost=192.168.56.1 -Dsocks5ProxyPort=1080"