Add kcptun conn configure.

This commit is contained in:
Charlie Qiu
2017-01-15 22:49:24 +08:00
parent 489d9fe71b
commit f5bd02e98b
2 changed files with 3 additions and 0 deletions

View File

@ -96,6 +96,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
"LocalHTTP.FollowGlobal": true,
"Kcptun.LocalHost": "127.0.0.1",
"Kcptun.LocalPort": NSNumber(value: 8388),
"Kcptun.Conn": NSNumber(value: 1),
])
statusItem = NSStatusBar.system().statusItem(withLength: AppDelegate.StatusItemIconWidth)

View File

@ -64,6 +64,7 @@ class KcptunProfile: NSObject {
let defaults = UserDefaults.standard
let localHost = defaults.string(forKey: "Kcptun.LocalHost")! as String
let localPort = defaults.integer(forKey: "Kcptun.LocalPort")
let connNum = defaults.integer(forKey: "Kcptun.Conn")
let conf: [String: AnyObject] = [
"localaddr": "\(localHost):\(localPort)" as AnyObject,
@ -74,6 +75,7 @@ class KcptunProfile: NSObject {
"datashard": NSNumber(value: self.datashard),
"parityshard": NSNumber(value: self.parityshard),
"mtu": NSNumber(value: self.mtu),
"conn": NSNumber(value: connNum),
]
return conf
}