Windows の Git bash で Proxyを経由できるよう設定する
vagrant で環境構築しようと思ったところ Proxy 環境下であったためダウンロードができませんでした。Windows 環境の Git bash で .bash_profile , .bashrc を使って環境設定を行っていきます。
Proxy Proxyを経由できるよう設定する
Windows 環境の Git bash に .bash_profile 用意し、 .bashrc を読むようファイルを作成していきます。
Git bash を起動し、ホームディレクトリにいることを確認します。最初に .bash_profile を作成していきます。
$ vi .bash_profile
.bash_profile には、次のよう記述します。
if [ -f ~/.bashrc ] ; then
. ~/.bashrc
fi
次に .bashrc へ Proxy の設定を作成します。
$ vi .bashrc
PROXY="ユーザー名:パスワード@アドレス:ポート
# 認証がない場合は、"アドレス:ポート"
export http_proxy="http://$PROXY"
export https_proxy="http://$PROXY"
export ftp_proxy="http://$PROXY"
export no_proxy="127.0.0.1,localhost"
.bash_profile はログイン時に読まれるので Git bash を再起動し環境変数に反映させます。
以上で Proxy を経由できるようになります。