mirror of
https://github.com/fankes/beszel.git
synced 2025-10-19 01:39:34 +08:00
feat: add unix socket support for system connections
This commit is contained in:
@@ -421,7 +421,14 @@ func (h *Hub) deleteSystemConnection(record *core.Record) {
|
||||
}
|
||||
|
||||
func (h *Hub) createSystemConnection(record *core.Record) (*ssh.Client, error) {
|
||||
client, err := ssh.Dial("tcp", net.JoinHostPort(record.GetString("host"), record.GetString("port")), h.sshClientConfig)
|
||||
network := "tcp"
|
||||
host := record.GetString("host")
|
||||
if strings.HasPrefix(host, "/") {
|
||||
network = "unix"
|
||||
} else {
|
||||
host = net.JoinHostPort(host, record.GetString("port"))
|
||||
}
|
||||
client, err := ssh.Dial(network, host, h.sshClientConfig)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user