Add kcptun conn configure.
This commit is contained in:
@ -96,6 +96,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
|||||||
"LocalHTTP.FollowGlobal": true,
|
"LocalHTTP.FollowGlobal": true,
|
||||||
"Kcptun.LocalHost": "127.0.0.1",
|
"Kcptun.LocalHost": "127.0.0.1",
|
||||||
"Kcptun.LocalPort": NSNumber(value: 8388),
|
"Kcptun.LocalPort": NSNumber(value: 8388),
|
||||||
|
"Kcptun.Conn": NSNumber(value: 1),
|
||||||
])
|
])
|
||||||
|
|
||||||
statusItem = NSStatusBar.system().statusItem(withLength: AppDelegate.StatusItemIconWidth)
|
statusItem = NSStatusBar.system().statusItem(withLength: AppDelegate.StatusItemIconWidth)
|
||||||
|
@ -64,6 +64,7 @@ class KcptunProfile: NSObject {
|
|||||||
let defaults = UserDefaults.standard
|
let defaults = UserDefaults.standard
|
||||||
let localHost = defaults.string(forKey: "Kcptun.LocalHost")! as String
|
let localHost = defaults.string(forKey: "Kcptun.LocalHost")! as String
|
||||||
let localPort = defaults.integer(forKey: "Kcptun.LocalPort")
|
let localPort = defaults.integer(forKey: "Kcptun.LocalPort")
|
||||||
|
let connNum = defaults.integer(forKey: "Kcptun.Conn")
|
||||||
|
|
||||||
let conf: [String: AnyObject] = [
|
let conf: [String: AnyObject] = [
|
||||||
"localaddr": "\(localHost):\(localPort)" as AnyObject,
|
"localaddr": "\(localHost):\(localPort)" as AnyObject,
|
||||||
@ -74,6 +75,7 @@ class KcptunProfile: NSObject {
|
|||||||
"datashard": NSNumber(value: self.datashard),
|
"datashard": NSNumber(value: self.datashard),
|
||||||
"parityshard": NSNumber(value: self.parityshard),
|
"parityshard": NSNumber(value: self.parityshard),
|
||||||
"mtu": NSNumber(value: self.mtu),
|
"mtu": NSNumber(value: self.mtu),
|
||||||
|
"conn": NSNumber(value: connNum),
|
||||||
]
|
]
|
||||||
return conf
|
return conf
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user