feat: close connection if no tunneling request is specified
All checks were successful
Docker Build and Push / build-and-push (push) Successful in 7m18s

This commit is contained in:
2025-10-20 12:28:52 +00:00
parent 659b2b82ec
commit e02b7ed937
7 changed files with 82 additions and 66 deletions

View File

@ -1,9 +1,10 @@
package session
import (
"golang.org/x/crypto/ssh"
"net"
"sync"
"golang.org/x/crypto/ssh"
)
type TunnelType string
@ -44,7 +45,6 @@ func New(conn *ssh.ServerConn, forwardingReq <-chan *ssh.Request) *Session {
ch, reqs, _ := channel.Accept()
if session.ConnChannel == nil {
session.ConnChannel = ch
session.Status = RUNNING
go session.HandleGlobalRequest(forwardingReq)
}
go session.HandleGlobalRequest(reqs)