proxy

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadAuthorizedKey

func LoadAuthorizedKey(p string) (pubKey ssh.PublicKey, err error)

?? path: /home/account/.ssh/id_rsa.pub

func LoadKnownHosts

func LoadKnownHosts(keyPath string) (pubKey ssh.PublicKey, err error)

?? path: /home/account/.ssh/known_hosts

func LoadPrivateKey

func LoadPrivateKey(p string) (signer ssh.Signer, err error)

path: /home/account/.ssh/id_rsa LoadPrivateKey loads an RSA private key from a file

Types

type Logger

type Logger struct {
	*zap.Logger
}

func NewLogger

func NewLogger(lg *zap.Logger) *Logger

func (*Logger) StdLogger

func (self *Logger) StdLogger() *log.Logger

func (*Logger) Write

func (self *Logger) Write(p []byte) (int, error)

implements io.Writer for socks5.Config.Logger

type Proxy

type Proxy struct {
	SSH_Address    string `mapstructure:"ssh_address"`
	SSH_User       string `mapstructure:"ssh_user"`
	SSH_Password   string `mapstructure:"ssh_password"`
	SSH_PrivateKey string `mapstructure:"ssh_private_key"`
	SSH_KnownHosts string `mapstructure:"ssh_known_hosts"`

	Socks5User     string `mapstructure:"socks5_user"`
	Socks5Password string `mapstructure:"socks5_password"`

	*ssh.Client `mapstructure:"-"`
	Logger      *Logger `mapstructure:"-"`
}

func LoadProxy

func LoadProxy(fp string, key string, logger *zap.Logger) (config *Proxy, err error)

func (*Proxy) AuthMethods

func (self *Proxy) AuthMethods() string

ssh auth methods

func (*Proxy) Close

func (self *Proxy) Close() (err error)

func (*Proxy) Resolve

func (self *Proxy) Resolve(ctx context.Context, name string) (
	c context.Context, ip net.IP, err error)

func (*Proxy) Socks5Config

func (self *Proxy) Socks5Config() (config *socks5.Config)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL