How to configure a proxy in a new network location using Terminal.app

bashPROXYterminal

I'm writing a bash script, which will create new network location and configure it. The question is – how to add proxy settings to specific network location using terminal or bash script?

P.S. I'm creating new location using networksetup -createlocation <location name>

Best Answer

Found this networksetup manual. To do this, you just need to write

networksetup -setwebproxy "Service name (e.g. Wi-Fi)" proxy.server.com port