From f5bd02e98b4f7fb5fa8261319e8fb95b81f16878 Mon Sep 17 00:00:00 2001 From: Charlie Qiu Date: Sun, 15 Jan 2017 22:49:24 +0800 Subject: [PATCH] Add kcptun conn configure. --- ShadowsocksX-NG/AppDelegate.swift | 1 + ShadowsocksX-NG/KcptunProfile.swift | 2 ++ 2 files changed, 3 insertions(+) diff --git a/ShadowsocksX-NG/AppDelegate.swift b/ShadowsocksX-NG/AppDelegate.swift index 787ec13..6e9c19a 100755 --- a/ShadowsocksX-NG/AppDelegate.swift +++ b/ShadowsocksX-NG/AppDelegate.swift @@ -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) diff --git a/ShadowsocksX-NG/KcptunProfile.swift b/ShadowsocksX-NG/KcptunProfile.swift index 30ef470..110e4da 100644 --- a/ShadowsocksX-NG/KcptunProfile.swift +++ b/ShadowsocksX-NG/KcptunProfile.swift @@ -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 }