User can set use aes or gzip

This commit is contained in:
Gogs
2016-06-14 16:58:53 +08:00
parent 740fb05b21
commit ab6c5c813e
7 changed files with 173 additions and 83 deletions

View File

@@ -38,7 +38,7 @@ type ProxyServer struct {
CustomDomains []string
// configure in frpc.ini
UseEncryption bool
UseEncryption int
Status int64
CtlConn *conn.Conn // control connection with frpc
@@ -144,11 +144,7 @@ func (p *ProxyServer) Start(c *conn.Conn) (err error) {
log.Debug("Join two connections, (l[%s] r[%s]) (l[%s] r[%s])", workConn.GetLocalAddr(), workConn.GetRemoteAddr(),
userConn.GetLocalAddr(), userConn.GetRemoteAddr())
if p.UseEncryption {
go conn.JoinMore(userConn, workConn, p.AuthToken)
} else {
go conn.Join(userConn, workConn)
}
go conn.JoinMore(userConn, workConn, p.AuthToken, p.UseEncryption)
}()
}
}(listener)