proxy

package module
Version: v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

README

socks5-proxy

This is a go library for starting a socks5 proxy server via SSH.

It is intended to be used as a library by Golang CLIs that need to proxy via an SSH jumpbox, which is a common configuration for BOSH operators, so several CLIs in CLoud Foundry could benifit by its use.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSSHClientConfig

func NewSSHClientConfig(user string, hostKeyCallback ssh.HostKeyCallback, authMethods ...ssh.AuthMethod) *ssh.ClientConfig

func StartTestSSHServer

func StartTestSSHServer(httpServerURL, sshPrivateKey, userName string) string

Types

type DialFunc

type DialFunc func(network, address string) (net.Conn, error)

type HostKey

type HostKey struct{}

func NewHostKey

func NewHostKey() HostKey

func (HostKey) Get

func (h HostKey) Get(username, privateKey, serverURL string) (ssh.PublicKey, error)

type Socks5Proxy

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

func NewSocks5Proxy

func NewSocks5Proxy(hostKey hostKey, logger *log.Logger, keepAliveInterval time.Duration) *Socks5Proxy

func (*Socks5Proxy) Addr

func (s *Socks5Proxy) Addr() (string, error)

func (*Socks5Proxy) Dialer

func (s *Socks5Proxy) Dialer(username, key, url string) (DialFunc, error)

func (*Socks5Proxy) Start

func (s *Socks5Proxy) Start(username, key, url string) error

func (*Socks5Proxy) StartWithDialer

func (s *Socks5Proxy) StartWithDialer(dialer DialFunc) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL