all: now messages between frps and frpc can be encryped when use_encryption set true

This commit is contained in:
fatedier
2016-03-31 18:48:18 +08:00
parent 52f99bbc00
commit 80fc76da52
11 changed files with 73 additions and 44 deletions

View File

@@ -131,9 +131,10 @@ func loginToServer(cli *client.ProxyClient) (c *conn.Conn, err error) {
}
req := &msg.ControlReq{
Type: consts.NewCtlConn,
ProxyName: cli.Name,
Passwd: cli.Passwd,
Type: consts.NewCtlConn,
ProxyName: cli.Name,
Passwd: cli.Passwd,
UseEncryption: cli.UseEncryption,
}
buf, _ := json.Marshal(req)
err = c.Write(string(buf) + "\n")

View File

@@ -212,6 +212,9 @@ func doLogin(req *msg.ControlReq, c *conn.Conn) (ret int64, info string) {
return
}
// set infomations from frpc
s.UseEncryption = req.UseEncryption
// start proxy and listen for user connections, no block
err := s.Start()
if err != nil {