refactor: seperate application into seperate files and add killForwarding

This commit is contained in:
Patryk Hegenberg 2025-01-03 12:50:04 +01:00
parent fec43ea77d
commit a7ea6f41a7
7 changed files with 481 additions and 357 deletions

18
ssh.go Normal file
View file

@ -0,0 +1,18 @@
package main
import "golang.org/x/crypto/ssh"
type SSHConnection struct {
client *ssh.Client
session *ssh.Session
}
func (s *SSHConnection) Close() {
if s.session != nil {
s.session.Close()
}
if s.client != nil {
s.client.Close()
}
}