Documentation
¶
Overview ¶
Package qssh provides a QUIC-based SSH client implementation.
A QSSH server should be running on the target node. This package allows establishing SSH connections over QUIC. The main purpose of this package is to improve SSH reliability over low network conditions. It supports both direct SSH client connections and proxy mode for SSH tunneling.
Basic usage:
config := qssh.PasswordConfig("user", "password")
client, conn, err := qssh.Dial("server:8080", config)
if err != nil {
log.Fatal(err)
}
defer client.Close()
defer conn.Close()
Proxy usage:
err := qssh.Proxy(ctx, "proxy-server:8080", qssh.ProxyConfig{
TLSConfig: &tls.Config{InsecureSkipVerify: true},
}, os.Stdin, os.Stdout)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// SSH configuration
SSHConfig *ssh.ClientConfig
// TLS configuration for QUIC
TLSConfig *tls.Config
QUICConfig *quic.Config
DialTimeout time.Duration
}
func DefaultConfig ¶
func DefaultConfig(user string, auth []ssh.AuthMethod) Config
DefaultConfig returns a configuration with sensible defaults
func PasswordConfig ¶
PasswordConfig creates a config with password authentication
func (*Config) WithClientCert ¶
WithClientCert adds client certificate authentication to the TLS config for mTLS
func (*Config) WithServerCA ¶
WithServerCA adds server CA verification to the TLS config
type ProxyConfig ¶
type QSSHConnection ¶
func Dial ¶
Dial connects to the QSSH server and returns an ssh.Client and QSSH connection. Both ssh.Client and QSSH connection should be closed by the caller.
func DialContext ¶
func DialContext(ctx context.Context, addr string, config Config) (*ssh.Client, *QSSHConnection, error)
DialContext connects to the QSSH server using the provided context and returns an ssh.Client and QSSH connection. Both ssh.Client and QSSH connection should be closed by the caller.
func (QSSHConnection) Close ¶
func (q QSSHConnection) Close() error
func (QSSHConnection) LocalAddr ¶
func (q QSSHConnection) LocalAddr() net.Addr
func (QSSHConnection) RemoteAddr ¶
func (q QSSHConnection) RemoteAddr() net.Addr