Skip to content

Instantly share code, notes, and snippets.

@fernyb
Last active August 29, 2015 14:10
Show Gist options
  • Save fernyb/2e8348ab916dd240a39c to your computer and use it in GitHub Desktop.
Save fernyb/2e8348ab916dd240a39c to your computer and use it in GitHub Desktop.
Mac OSX Settting Proxy via Command Line
Show the active interface:
ifconfig | pcregrep -M -o '^[^\t:]+:([^\n]|\n\t)*status: active'
List All Network Services with information which interface they use:
sudo networksetup -listnetworkserviceorder
To set the Proxy:
sudo networksetup -setwebproxystate "Wi-Fi" off
sudo networksetup -setwebproxy "Wi-Fi" 127.0.0.1 8080
To turn off proxy
sudo networksetup -setwebproxystate "Wi-Fi" off
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment