Skip to main content

プロキシを利用する

Ionic CLI には、プロキシ機能が内蔵されています。プロキシの設定は、設定ファイルや環境変数を通じて行うことができます。

設定ファイルを通じてプロキシ設定を設定するには、プロキシサーバーの URL を指定して、以下のコマンドを実行してください。

ionic config set -g proxy http://proxy.example.com:8888

環境変数を通じてプロキシの設定を変更する場合は、以下のいずれかを使用してください。

$ export HTTP_PROXY="http://proxy.example.com:8888" # also used by npm
$ export HTTPS_PROXY="https://proxy.example.com:8888" # also used by npm
$ export IONIC_HTTP_PROXY="http://proxy.example.com:8888"

他の CLI​

使用する各 CLI は、ネットワークリクエストをプロキシするように、個別に設定する必要があります。

npm​

npm config set proxy http://proxy.company.com:8888

git​

git config --global http.proxy http://proxy.example.com:8888

SSL の設定​

Ionic CLI では、HTTP リクエストに使用する SSL 設定を様々に設定することができます。

$ ionic config set -g ssl.cafile /path/to/cafile # file path to your CA root certificate
$ ionic config set -g ssl.certfile /path/to/certfile # file path to a client certificate
$ ionic config set -g ssl.keyfile /path/to/keyfile # file path to a client key file

cafile、certfile、keyfileといったエントリは、~/.ionic/config.jsonファイル内で文字列の配列として手動で編集することができます。これにより、複数のファイルを指定することができます。