LoginSignup
54
45

More than 5 years have passed since last update.

認証情報に記号があるときのproxy設定

Posted at

proxy環境下でyumやpipなど使いたいときにはproxy設定を入れるが、proxyに認証があるとユーザ名・パスワードも入れないといけないので、下記の形式で環境変数を設定したりする。

(Windowsの場合の例)

set HTTP_PROXY=http://username:password@proxyhost:port
set HTTPS_PROXY=http://username:password@proxyhost:port

ここでusernameやpasswordに記号(\とか@とか^とか…)が入っているとき、そのまま指定することはできない。
URLエンコードする必要がある。

(ユーザ名がdomain\username、パスワードがp@ssのとき)

set HTTP_PROXY=http://domain%5cusername:p%40ss@proxyhost:port
set HTTPS_PROXY=http://domain%5cusername:p%40ss@proxyhost:port

web系の人には常識中の常識なんだろうけど、あまり記号のあるケースの記事もなく、気づくのに結構かかってしまった。

54
45
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
54
45