14
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

コマンドラインからWebプロキシの設定

Posted at

頻繁にWebプロキシの設定を変更する場合、いちいちシステム環境設定から行うのは面倒です。
コマンドラインからのWebプロキシの設定方法は以下のとおりです。

■Webプロキシの設定
$ sudo networksetup -setwebproxy Wi-Fi <domain> <port> on <user> <pass>

■Webプロキシの状態取得
$ networksetup -getwebproxy Wi-Fi

■Webプロキシの入切り
$ sudo networksetup -setwebproxystate Wi-Fi off
$ sudo networksetup -setwebproxystate Wi-Fi on

上記全て Wi-Fi の部分は、有線Lanでは Ethernet として下さい。
詳しくは下記を参照

■ネットワークデバイスの一覧表示
$ networksetup -listallnetworkservices

14
12
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
14
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?