mirror of
https://github.com/ehang-io/nps.git
synced 2025-09-02 03:16:53 +00:00
https 、客户端与服务端连接优化
This commit is contained in:
@@ -40,7 +40,8 @@ func (s *BaseController) display(tpl ...string) {
|
||||
}
|
||||
ip := s.Ctx.Request.Host
|
||||
if strings.LastIndex(ip, ":") > 0 {
|
||||
s.Data["ip"] = utils.GetHostByName(ip[0:])
|
||||
arr := strings.Split(utils.GetHostByName(ip), ":")
|
||||
s.Data["ip"] = arr[0]
|
||||
}
|
||||
s.Data["p"] = server.Bridge.TunnelPort
|
||||
s.Data["proxyPort"] = beego.AppConfig.String("hostPort")
|
||||
|
@@ -38,7 +38,6 @@ func (s *ClientController) Add() {
|
||||
P: s.GetString("p"),
|
||||
Compress: s.GetString("compress"),
|
||||
Crypt: s.GetBoolNoErr("crypt"),
|
||||
Mux: s.GetBoolNoErr("mux"),
|
||||
},
|
||||
RateLimit: s.GetIntNoErr("rate_limit"),
|
||||
Flow: &utils.Flow{
|
||||
@@ -91,7 +90,6 @@ func (s *ClientController) Edit() {
|
||||
c.Cnf.P = s.GetString("p")
|
||||
c.Cnf.Compress = s.GetString("compress")
|
||||
c.Cnf.Crypt = s.GetBoolNoErr("crypt")
|
||||
c.Cnf.Mux = s.GetBoolNoErr("mux")
|
||||
c.Flow.FlowLimit = int64(s.GetIntNoErr("flow_limit"))
|
||||
c.RateLimit = s.GetIntNoErr("rate_limit")
|
||||
if c.Rate != nil {
|
||||
|
@@ -81,7 +81,6 @@ func (s *IndexController) Add() {
|
||||
P: s.GetString("p"),
|
||||
Compress: s.GetString("compress"),
|
||||
Crypt: s.GetBoolNoErr("crypt"),
|
||||
Mux: s.GetBoolNoErr("mux"),
|
||||
},
|
||||
Id: server.CsvDb.GetTaskId(),
|
||||
UseClientCnf: s.GetBoolNoErr("use_client"),
|
||||
@@ -136,7 +135,6 @@ func (s *IndexController) Edit() {
|
||||
t.Config.P = s.GetString("p")
|
||||
t.Config.Compress = s.GetString("compress")
|
||||
t.Config.Crypt = s.GetBoolNoErr("crypt")
|
||||
t.Config.Mux = s.GetBoolNoErr("mux")
|
||||
t.UseClientCnf = s.GetBoolNoErr("use_client")
|
||||
t.Remark = s.GetString("remark")
|
||||
if t.Client, err = server.CsvDb.GetClient(s.GetIntNoErr("client_id")); err != nil {
|
||||
|
Reference in New Issue
Block a user