utils/conn: add func joinMore

This commit is contained in:
fatedier
2016-03-28 11:22:36 +08:00
parent b6212afb03
commit 45c21b2705
4 changed files with 50 additions and 30 deletions

View File

@@ -82,8 +82,7 @@ func (p *ProxyClient) StartTunnel(serverAddr string, serverPort int64) (err erro
log.Debug("Join two conns, (l[%s] r[%s]) (l[%s] r[%s])", localConn.GetLocalAddr(), localConn.GetRemoteAddr(),
remoteConn.GetLocalAddr(), remoteConn.GetRemoteAddr())
// go conn.Join(localConn, remoteConn)
go conn.PipeEncryptoWriter(localConn.TcpConn, remoteConn.TcpConn, p.Passwd)
go conn.PipeDecryptoReader(remoteConn.TcpConn, localConn.TcpConn, p.Passwd)
go conn.JoinMore(localConn, remoteConn, p.Passwd)
return nil
}

View File

@@ -133,8 +133,7 @@ func (p *ProxyServer) Start() (err error) {
log.Debug("Join two conns, (l[%s] r[%s]) (l[%s] r[%s])", cliConn.GetLocalAddr(), cliConn.GetRemoteAddr(),
userConn.GetLocalAddr(), userConn.GetRemoteAddr())
// go conn.Join(cliConn, userConn)
go conn.PipeEncryptoWriter(userConn.TcpConn, cliConn.TcpConn, p.Passwd)
go conn.PipeDecryptoReader(cliConn.TcpConn, userConn.TcpConn, p.Passwd)
go conn.JoinMore(userConn, cliConn, p.Passwd)
}
}()