mirror of
https://github.com/ehang-io/nps.git
synced 2025-08-31 17:56:56 +00:00
MUX optimization
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"github.com/cnlh/nps/client"
|
||||
"github.com/cnlh/nps/lib/common"
|
||||
"github.com/cnlh/nps/lib/daemon"
|
||||
"github.com/cnlh/nps/lib/version"
|
||||
"github.com/cnlh/nps/vender/github.com/astaxie/beego/logs"
|
||||
"os"
|
||||
"strings"
|
||||
@@ -44,14 +45,15 @@ func main() {
|
||||
}
|
||||
env := common.GetEnvMap()
|
||||
if *serverAddr == "" {
|
||||
*serverAddr, _ = env["NPS_SERVER_ADDR"]
|
||||
*serverAddr, _ = env["NPC_SERVER_ADDR"]
|
||||
}
|
||||
if *verifyKey == "" {
|
||||
*verifyKey, _ = env["NPS_SERVER_VKEY"]
|
||||
*verifyKey, _ = env["NPC_SERVER_VKEY"]
|
||||
}
|
||||
logs.Info("the version of client is %s", version.VERSION)
|
||||
if *verifyKey != "" && *serverAddr != "" && *configPath == "" {
|
||||
for {
|
||||
client.NewRPClient(*serverAddr, *verifyKey, *connType, *proxyUrl).Start()
|
||||
client.NewRPClient(*serverAddr, *verifyKey, *connType, *proxyUrl, nil).Start()
|
||||
logs.Info("It will be reconnected in five seconds")
|
||||
time.Sleep(time.Second * 5)
|
||||
}
|
||||
|
@@ -6,6 +6,7 @@ import (
|
||||
"github.com/cnlh/nps/lib/daemon"
|
||||
"github.com/cnlh/nps/lib/file"
|
||||
"github.com/cnlh/nps/lib/install"
|
||||
"github.com/cnlh/nps/lib/version"
|
||||
"github.com/cnlh/nps/server"
|
||||
"github.com/cnlh/nps/server/connection"
|
||||
"github.com/cnlh/nps/server/test"
|
||||
@@ -54,9 +55,10 @@ func main() {
|
||||
}
|
||||
bridgePort, err := beego.AppConfig.Int("bridge_port")
|
||||
if err != nil {
|
||||
logs.Error("Getting bridgePort error", err)
|
||||
logs.Error("Getting bridge_port error", err)
|
||||
os.Exit(0)
|
||||
}
|
||||
logs.Info("the version of server is %s ,allow client version to be %s", version.VERSION, version.GetVersion())
|
||||
connection.InitConnectionService()
|
||||
server.StartNewServer(bridgePort, task, beego.AppConfig.String("bridge_type"))
|
||||
}
|
||||
|
Reference in New Issue
Block a user