Documentation ¶
Index ¶
- func DefaultSshClientFactory(conf SSHConf) (*ssh.Client, error)
- func NewNameResolverSimple(servers []string) *nameResolverSimple
- func OptNameResolverFactory(nameResolverFactory NameResolverFactory) func(box *SSHBox) error
- func OptSSHClientFactory(factory SshClientFactory) func(box *SSHBox) error
- func OptSocksConf(conf *socks5.Config) func(box *SSHBox) error
- type DnsConfig
- type Emitter
- func (em *Emitter) EmitStopSocks()
- func (em *Emitter) EmitStopSsh()
- func (em *Emitter) EmitStopTunnels()
- func (em *Emitter) ListenersStartTunnels() []<-chan emitter.Event
- func (em *Emitter) ListenersStopSocks() []<-chan emitter.Event
- func (em *Emitter) ListenersStopSsh() []<-chan emitter.Event
- func (em *Emitter) ListenersStopTunnels() []<-chan emitter.Event
- func (em *Emitter) OffStartTunnels(events ...<-chan emitter.Event)
- func (em *Emitter) OffStopSocks(events ...<-chan emitter.Event)
- func (em *Emitter) OffStopSsh(events ...<-chan emitter.Event)
- func (em *Emitter) OffStopTunnels(events ...<-chan emitter.Event)
- func (em *Emitter) OnStartTunnels() <-chan emitter.Event
- func (em *Emitter) OnStopSocks() <-chan emitter.Event
- func (em *Emitter) OnStopSsh() <-chan emitter.Event
- func (em *Emitter) OnStopTunnels() <-chan emitter.Event
- func (em *Emitter) ToError(evt emitter.Event) error
- type ErrLoad
- type GatewayInfo
- type Gateways
- type InteractiveSSH
- type NameResolver
- type NameResolverFactory
- type PublicKeys
- type SSHBox
- func (t SSHBox) Emitter() *Emitter
- func (t *SSHBox) HandleRTunnelClient(client net.Conn, target *TunnelTarget)
- func (t *SSHBox) HandleTunnelClient(client net.Conn, target *TunnelTarget)
- func (t *SSHBox) SSHClient() *ssh.Client
- func (t *SSHBox) StartSocksServer(port int, network string) error
- func (t *SSHBox) StartTunnels(tunnelTargets []*TunnelTarget) error
- func (t *SSHBox) StopSSH()
- func (t *SSHBox) StopSocksServer()
- func (t *SSHBox) StopTunnelsServer()
- type SSHBoxOptions
- type SSHConf
- type SshClientFactory
- type TTYRequest
- type TunnelTarget
- type TunnelTargets
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewNameResolverSimple ¶
func NewNameResolverSimple(servers []string) *nameResolverSimple
func OptNameResolverFactory ¶
func OptNameResolverFactory(nameResolverFactory NameResolverFactory) func(box *SSHBox) error
func OptSSHClientFactory ¶
func OptSSHClientFactory(factory SshClientFactory) func(box *SSHBox) error
func OptSocksConf ¶
Types ¶
type DnsConfig ¶
type DnsConfig struct { Servers []string // servers to use Search []string // suffixes to append to local name Ndots int // number of dots in name to trigger absolute lookup Timeout int // seconds before giving up on packet Attempts int // lost packets before giving up on server Rotate bool // round robin among servers UnknownOpt bool // anything unknown was encountered Lookup []string // OpenBSD top-level database "lookup" order Err error // any error that occurs during open of resolv.conf }
func DnsConfFromSSH ¶
type Emitter ¶
type Emitter struct {
// contains filtered or unexported fields
}
func NewEmitter ¶
func NewEmitter() *Emitter
func (*Emitter) EmitStopSocks ¶
func (em *Emitter) EmitStopSocks()
func (*Emitter) EmitStopSsh ¶
func (em *Emitter) EmitStopSsh()
func (*Emitter) EmitStopTunnels ¶
func (em *Emitter) EmitStopTunnels()
func (*Emitter) ListenersStartTunnels ¶
func (*Emitter) ListenersStopSocks ¶
func (*Emitter) ListenersStopSsh ¶
func (*Emitter) ListenersStopTunnels ¶
func (*Emitter) OffStartTunnels ¶
func (*Emitter) OffStopSocks ¶
func (*Emitter) OffStopSsh ¶
func (*Emitter) OffStopTunnels ¶
func (*Emitter) OnStartTunnels ¶
func (*Emitter) OnStopSocks ¶
func (*Emitter) OnStopTunnels ¶
type GatewayInfo ¶
type Gateways ¶
type Gateways struct {
// contains filtered or unexported fields
}
func NewGateways ¶
type InteractiveSSH ¶
type InteractiveSSH struct {
// contains filtered or unexported fields
}
func NewInteractiveSSH ¶
func NewInteractiveSSH(sshBox *SSHBox) *InteractiveSSH
func (*InteractiveSSH) Interactive ¶
func (c *InteractiveSSH) Interactive() error
func (*InteractiveSSH) InteractiveSession ¶
func (c *InteractiveSSH) InteractiveSession(commands []string, terminalRequest TTYRequest) error
func (*InteractiveSSH) RunCmd ¶
func (c *InteractiveSSH) RunCmd(cmd []string) error
func (*InteractiveSSH) Stop ¶
func (c *InteractiveSSH) Stop() error
type NameResolver ¶
type NameResolver interface {
Resolve(ctx netctx.Context, name string) (context.Context, net.IP, error)
}
func NameResolverFactorySSH ¶
func NameResolverFactorySSH(sshBox *SSHBox) (NameResolver, error)
type NameResolverFactory ¶
type NameResolverFactory func(sshBox *SSHBox) (NameResolver, error)
type PublicKeys ¶
PublicKeys implements AuthMethod by using the given key pairs.
func NewPublicKeys ¶
func NewPublicKeys(pemBytes []byte, password string) (*PublicKeys, error)
func NewPublicKeysFromFile ¶
func NewPublicKeysFromFile(pemFile, password string) (*PublicKeys, error)
type SSHBox ¶
type SSHBox struct {
// contains filtered or unexported fields
}
func (*SSHBox) HandleRTunnelClient ¶ added in v0.1.2
func (t *SSHBox) HandleRTunnelClient(client net.Conn, target *TunnelTarget)
func (*SSHBox) HandleTunnelClient ¶ added in v0.1.2
func (t *SSHBox) HandleTunnelClient(client net.Conn, target *TunnelTarget)
func (*SSHBox) StartTunnels ¶
func (t *SSHBox) StartTunnels(tunnelTargets []*TunnelTarget) error
func (*SSHBox) StopSocksServer ¶
func (t *SSHBox) StopSocksServer()
func (*SSHBox) StopTunnelsServer ¶
func (t *SSHBox) StopTunnelsServer()
type SSHBoxOptions ¶
type SSHConf ¶
type SSHConf struct { SSHUri string User string Password string PrivateKey string Passphrase string HostKeyFingerprint string SSHAuthSock *string NoSSHAgent bool }
func (*SSHConf) CheckAndFill ¶
type TTYRequest ¶
type TTYRequest int
const ( RequestTTYAuto TTYRequest = iota RequestTTYNo RequestTTYYes RequestTTYForce )
type TunnelTarget ¶
type TunnelTarget struct { Network string RemoteHost string RemotePort int LocalPort int Reverse bool }
func DNSServerToTunnel ¶
func DNSServerToTunnel(dnsservers []string) ([]*TunnelTarget, error)
func (*TunnelTarget) CheckAndFill ¶
func (c *TunnelTarget) CheckAndFill() error
type TunnelTargets ¶
type TunnelTargets []*TunnelTarget
Source Files ¶
Click to show internal directories.
Click to hide internal directories.