add keepalive for ssh

This commit is contained in:
ginuerzh
2023-03-03 13:06:20 +08:00
parent 54046d2003
commit 7a21c7eb6f
13 changed files with 213 additions and 219 deletions

View File

@ -188,6 +188,8 @@ func (l *sshdListener) serveConn(conn net.Conn) {
req.Reply(false, []byte("connection queue is full"))
cc.Close()
}
case "ping":
req.Reply(true, []byte("pong"))
default:
l.logger.Warnf("unsupported request type: %s, want reply: %v", req.Type, req.WantReply)
req.Reply(false, nil)