在 Mac 上切换代理是一件麻烦的事情,然而不幸的是一旦你有了这个需求往往也意味着你需要频繁进行这个操作
于是我造了这个偷懒用的 alfredworkflow
希望有人能用得着
-
Download
https://github.com/IvanChou/Trace.alfredworkflow/raw/master/Trace%20(Proxy-helper).alfredworkflow
-
Setting
- Doubule click
trace
in Alfred Workflows Preferences - Click
Open workflow folder
to open Finder - Open
proxy.conf
and modify it like sample
- Doubule click
-
Use
Call out your alfred, and type
trace
-
Enjoy it!
When you change your proxy setting via Trace, OSX may ask your password to allow this operation everytime.
To slove this question, you can do something more:
-
add the following line to
/etc/sudoers/
yourusername ALL=NOPASSWD: /usr/sbin/networksetup # e.g. IChou ALL=NOPASSWD: /usr/sbin/networksetup
Remeber the file
/etc/sudoers/
must be end with a empty line!! -
re-link the scripts of trace
It's inspired by Fate. "Trace on!"