Commit 8feb587e authored by Max Lv's avatar Max Lv

Fix #923

parent 89f073cc
...@@ -112,8 +112,14 @@ class ShadowsocksNatService extends BaseService { ...@@ -112,8 +112,14 @@ class ShadowsocksNatService extends BaseService {
def startKcptunDaemon() { def startKcptunDaemon() {
if (profile.kcpcli == null) profile.kcpcli = "" if (profile.kcpcli == null) profile.kcpcli = ""
val host = if (profile.host.contains(":")) {
"[" + profile.host + "]"
} else {
profile.host
}
val cmd = ArrayBuffer[String](getApplicationInfo.dataDir + "/kcptun" val cmd = ArrayBuffer[String](getApplicationInfo.dataDir + "/kcptun"
, "-r", profile.host + ":" + profile.kcpPort , "-r", host + ":" + profile.kcpPort
, "-l", "127.0.0.1:" + (profile.localPort + 90)) , "-l", "127.0.0.1:" + (profile.localPort + 90))
try cmd ++= Utils.translateCommandline(profile.kcpcli) catch { try cmd ++= Utils.translateCommandline(profile.kcpcli) catch {
case exc: Exception => throw KcpcliParseException(exc) case exc: Exception => throw KcpcliParseException(exc)
......
...@@ -190,8 +190,14 @@ class ShadowsocksVpnService extends VpnService with BaseService { ...@@ -190,8 +190,14 @@ class ShadowsocksVpnService extends VpnService with BaseService {
def startKcptunDaemon() { def startKcptunDaemon() {
if (profile.kcpcli == null) profile.kcpcli = "" if (profile.kcpcli == null) profile.kcpcli = ""
val host = if (profile.host.contains(":")) {
"[" + profile.host + "]"
} else {
profile.host
}
val cmd = ArrayBuffer(getApplicationInfo.dataDir + "/kcptun" val cmd = ArrayBuffer(getApplicationInfo.dataDir + "/kcptun"
, "-r", profile.host + ":" + profile.kcpPort , "-r", host + ":" + profile.kcpPort
, "-l", "127.0.0.1:" + (profile.localPort + 90) , "-l", "127.0.0.1:" + (profile.localPort + 90)
, "--path", protectPath) , "--path", protectPath)
try cmd ++= Utils.translateCommandline(profile.kcpcli) catch { try cmd ++= Utils.translateCommandline(profile.kcpcli) catch {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment