Removes default bypass rules in proxy_conf_helper

This commit is contained in:
Haoyu Qiu
2017-11-05 09:21:57 +08:00
parent 56d052d160
commit bbb7981ee8
4 changed files with 32 additions and 12 deletions

View File

@ -103,6 +103,15 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
"Kcptun.LocalPort": NSNumber(value: 8388),
"Kcptun.Conn": NSNumber(value: 1),
])
// To keep the default exception values backward compatible, we set it
// to the previously hardcoded value if the key doesn't exist.
// Registering defaults won't work because the empty state is a valid
// value, and Cocoa Bindings won't distinguish between empty and string
// values.
if defaults.string(forKey: "ProxyExceptions") == nil {
defaults.set("127.0.0.1, localhost, 192.168.0.0/16, 10.0.0.0/8", forKey: "ProxyExceptions")
}
statusItem = NSStatusBar.system.statusItem(withLength: AppDelegate.StatusItemIconWidth)
let image : NSImage = NSImage(named: NSImage.Name(rawValue: "menu_icon"))!