更新两处http开关,随ss开启和关闭
This commit is contained in:
@ -166,6 +166,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
|||||||
func applicationWillTerminate(_ aNotification: Notification) {
|
func applicationWillTerminate(_ aNotification: Notification) {
|
||||||
// Insert code here to tear down your application
|
// Insert code here to tear down your application
|
||||||
StopSSLocal()
|
StopSSLocal()
|
||||||
|
StopPrivoxy()
|
||||||
ProxyConfHelper.disableProxy("hi")
|
ProxyConfHelper.disableProxy("hi")
|
||||||
let defaults = UserDefaults.standard
|
let defaults = UserDefaults.standard
|
||||||
defaults.set(false, forKey: "ShadowsocksOn")
|
defaults.set(false, forKey: "ShadowsocksOn")
|
||||||
@ -179,6 +180,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
|||||||
|
|
||||||
if isOn {
|
if isOn {
|
||||||
StartSSLocal()
|
StartSSLocal()
|
||||||
|
StartPrivoxy()
|
||||||
if mode == "auto" {
|
if mode == "auto" {
|
||||||
ProxyConfHelper.enablePACProxy("hi")
|
ProxyConfHelper.enablePACProxy("hi")
|
||||||
} else if mode == "global" {
|
} else if mode == "global" {
|
||||||
@ -188,6 +190,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
StopSSLocal()
|
StopSSLocal()
|
||||||
|
StopPrivoxy()
|
||||||
ProxyConfHelper.disableProxy("hi")
|
ProxyConfHelper.disableProxy("hi")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user