how to you toggle on and off a web proxy in os x from the command line

前端 未结 7 1455
予麋鹿
予麋鹿 2021-01-31 15:45

In OS X, you turn on and off a web proxy from System Preferences > Network > Proxies, by checking Web Proxy (HTTP) and designating the Web Proxy Server etc. and by clicking OK a

7条回答
  •  半阙折子戏
    2021-01-31 16:24

    Just the Toggling :)

    networksetup -setwebproxystate  
    networksetup -setsecurewebproxystate  
    

    Example :

    networksetup -setwebproxystate  Wi-Fi on
    networksetup -setsecurewebproxystate  Wi-Fi on
    

    To handle the Modification alert : prefix sudo like

    sudo networksetup -setwebproxystate  Wi-Fi on
    sudo networksetup -setsecurewebproxystate  Wi-Fi on
    

提交回复
热议问题