mirror of
https://github.com/moul/sshportal.git
synced 2025-10-05 02:44:50 +08:00
Implement @arkan's session.MaskedReqs
This commit is contained in:
parent
742cacf384
commit
84e8352338
1 changed files with 1 additions and 8 deletions
9
proxy.go
9
proxy.go
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue