Implement @arkan's session.MaskedReqs

This commit is contained in:
Manfred Touron 2017-10-30 12:30:34 +01:00
parent 742cacf384
commit 84e8352338

View file

@ -22,10 +22,7 @@ func proxy(s ssh.Session, config *Config) error {
}
log.Println("SSH Connectin established")
lreqs := make(chan *gossh.Request, 1)
defer close(lreqs)
return pipe(lreqs, rreqs, s, rch)
return pipe(s.MaskedReqs(), rreqs, s, rch)
}
func pipe(lreqs, rreqs <-chan *gossh.Request, lch, rch gossh.Channel) error {
@ -46,10 +43,6 @@ func pipe(lreqs, rreqs <-chan *gossh.Request, lch, rch gossh.Channel) error {
errch <- errors.New("rch closed the connection")
}()
go func() {
// FIXME: find a way to get the client requests
}()
for {
select {
case req := <-lreqs: // forward ssh requests from local to remote