connector

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connector

type Connector interface {
	Setup(net.Conn) (net.Conn, error)
}

Connector interface can set up a net.Conn for certain media

func NewTCPConnector

func NewTCPConnector() (Connector, error)

NewTCPConnector returns a new TCP connector

func NewTLSConnector

func NewTLSConnector(servername, cert, key string) (Connector, error)

NewTLSConnector returns a Connector, which can be used for TLS connections.

type SSHConnector

type SSHConnector struct {
	// Connect is the original connection
	Connect net.Conn
	// Addr is hostname:port of the SSH endpoint
	Addr string
	// Tunnel is hostname:port to be accessed through SSH
	Tunnel string
	Client *ssh.Client
	// contains filtered or unexported fields
}

SSHConnector is a Connector, which can connect using SSH through the original Connection

func NewSSHConnector

func NewSSHConnector(addr, tunnel, user, key string) (*SSHConnector, error)

NewSSHConnector sets up a new sshDialer for transmitting data through SSH tunnel

func (*SSHConnector) Setup

func (c *SSHConnector) Setup(conn net.Conn) (net.Conn, error)

Setup sets up the original net.Conn to connect through SSH

type TCPConnector

type TCPConnector struct{}

TCPConnector is a Connector implementation, providing pure TCP-based connection

func (*TCPConnector) Setup

func (*TCPConnector) Setup(conn net.Conn) (net.Conn, error)

Setup takes a net.Conn, and returns it verbatim.

type TLSConnector

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

TLSConnector is a Connector implementation to tunnel connections through TLS

func (*TLSConnector) Setup

func (c *TLSConnector) Setup(conn net.Conn) (net.Conn, error)

Setup takes a net.Conn, and implements a simple, non-checking TLS client with SNI requirements.

Jump to

Keyboard shortcuts

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