mirror of
https://github.com/bpg/terraform-provider-proxmox.git
synced 2025-06-30 10:33:46 +00:00
* feat(provider): add support for `ssh-agent` on Windows Signed-off-by: Brian Karshick <Sparta142@users.noreply.github.com>
25 lines
456 B
Go
25 lines
456 B
Go
//go:build windows
|
|
|
|
package ssh
|
|
|
|
import (
|
|
"fmt"
|
|
"net"
|
|
|
|
"github.com/Microsoft/go-winio"
|
|
)
|
|
|
|
// dialSocket dials a Windows named pipe. If address is empty, it dials the default ssh-agent pipe.
|
|
func dialSocket(address string) (net.Conn, error) {
|
|
if address == "" {
|
|
address = `\\.\pipe\openssh-ssh-agent`
|
|
}
|
|
|
|
conn, err := winio.DialPipe(address, nil)
|
|
if err != nil {
|
|
return nil, fmt.Errorf("error dialing named pipe: %w", err)
|
|
}
|
|
|
|
return conn, nil
|
|
}
|