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") log.Println("SSH Connectin established")
lreqs := make(chan *gossh.Request, 1) return pipe(s.MaskedReqs(), rreqs, s, rch)
defer close(lreqs)
return pipe(lreqs, rreqs, s, rch)
} }
func pipe(lreqs, rreqs <-chan *gossh.Request, lch, rch gossh.Channel) error { 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") errch <- errors.New("rch closed the connection")
}() }()
go func() {
// FIXME: find a way to get the client requests
}()
for { for {
select { select {
case req := <-lreqs: // forward ssh requests from local to remote case req := <-lreqs: // forward ssh requests from local to remote