proxy

package
v0.0.0-...-b015d54 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Http

func Http(client *http.Client, proxyAddr string, insecureSkipVerify bool, auths ...proxy.Auth) (err error)

func Socks5Proxy

func Socks5Proxy(dial Dial, localAddr string, auths ...BasicAuth) (
	listener net.Listener, err error)

func SshSignerFromPem

func SshSignerFromPem(fp, password string) (signer ssh.Signer, err error)

Types

type BasicAuth

type BasicAuth struct {
	User     string
	Password string
}

func (*BasicAuth) Valid

func (ba *BasicAuth) Valid(user, password string) bool

$ export http_proxy=socks5://hello:world@localhost:8080

type Dial

type Dial = func(string, string) (net.Conn, error)

network, address

type SshClient

type SshClient struct {
	// contains filtered or unexported fields
}

func NewSshClient

func NewSshClient(fp, key string) (client *SshClient, err error)

func (*SshClient) Dial

func (client *SshClient) Dial() (cli *ssh.Client, err error)

func (*SshClient) Forward

func (client *SshClient) Forward(localAddr, remoteAddr string) (listener net.Listener, err error)

func (*SshClient) RunCommand

func (client *SshClient) RunCommand(cmd string) (bts []byte, err error)

func (*SshClient) Socks5Proxy

func (client *SshClient) Socks5Proxy(localAddr string, secs int64, auths ...BasicAuth) (
	shutdown func(), err error)

func (*SshClient) WithLogger

func (client *SshClient) WithLogger(logger misc.LogIntf) *SshClient

type SshConfig

type SshConfig struct {
	User     string `mapstructure:"user"`
	Password string `mapstructure:"password"`

	PrivateKeyPath     string `mapstructure:"private_key_path"`
	PrivateKeyPassword string `mapstructure:"private_key_password"`

	Addr        string `mapstructure:"Addr"`
	Port        string `mapstructure:"port"`
	TimeoutSecs int64  `mapstructure:"timeout_secs"`
}

func (*SshConfig) Address

func (config *SshConfig) Address() string

Jump to

Keyboard shortcuts

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