Merge pull request #90 from fatedier/release0.8

merge some fix
This commit is contained in:
fatedier
2016-08-23 10:23:44 +08:00
committed by GitHub
13 changed files with 1005 additions and 132 deletions

View File

@@ -21,6 +21,7 @@ import (
"time"
"github.com/fatedier/frp/src/models/consts"
"github.com/fatedier/frp/src/models/metric"
"github.com/fatedier/frp/src/models/msg"
"github.com/fatedier/frp/src/models/server"
"github.com/fatedier/frp/src/utils/conn"
@@ -228,6 +229,7 @@ func doLogin(req *msg.ControlReq, c *conn.Conn) (ret int64, info string) {
} else if req.PrivilegeKey != privilegeKey {
info = fmt.Sprintf("ProxyName [%s], privilege mode authorization failed", req.ProxyName)
log.Warn(info)
log.Debug("PrivilegeKey [%s] and get [%s]", privilegeKey, req.PrivilegeKey)
return
}
} else {
@@ -240,6 +242,7 @@ func doLogin(req *msg.ControlReq, c *conn.Conn) (ret int64, info string) {
} else if req.AuthKey != authKey {
info = fmt.Sprintf("ProxyName [%s], authorization failed", req.ProxyName)
log.Warn(info)
log.Debug("AuthKey [%s] and get [%s]", authKey, req.AuthKey)
return
}
}
@@ -298,6 +301,9 @@ func doLogin(req *msg.ControlReq, c *conn.Conn) (ret int64, info string) {
return
}
// update metric's proxy status
metric.SetProxyInfo(s.Name, s.Type, s.BindAddr, s.UseEncryption, s.UseGzip, s.PrivilegeMode, s.CustomDomains, s.ListenPort)
// start proxy and listen for user connections, no block
err := s.Start(c)
if err != nil {