server

package
v0.0.0-...-dc1ddd1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHTTPTransport

func GetHTTPTransport(tunnel, ip, client_certficate string) (*http.Transport, error)

func LoadTLSConfig

func LoadTLSConfig(p string) (tlsConfig *tls.Config)

func LoadTLSConfigFromBytes

func LoadTLSConfigFromBytes(certPEM, keyPEM []byte) (tlsConfig *tls.Config)

func NewControl

func NewControl(ctlConn conn.Conn, authMsg *msg.Auth)

func NewProxy

func NewProxy(pxyConn conn.Conn, regPxy *msg.RegProxy)

func RegistryIDs

func RegistryIDs() map[string]string

func TunnelListener

func TunnelListener(addr string, tlsConfig *tls.Config)

Listen for incoming control and proxy connections We listen for incoming control and proxy connections on the same port for ease of deployment. The hope is that by running on port 443, using TLS and running all connections over the same port, we can bust through restrictive firewalls.

Types

type Control

type Control struct {
	// logger
	log.Logger
	// contains filtered or unexported fields
}

func GetControl

func GetControl(name string) *Control

func (*Control) Dial

func (c *Control) Dial(network, address string) (net.Conn, error)

func (*Control) GetProxy

func (c *Control) GetProxy() (proxyConn conn.Conn, err error)

Remove a proxy connection from the pool and return it If not proxy connections are in the pool, request one and wait until it is available Returns an error if we couldn't get a proxy because it took too long or the tunnel is closing

func (*Control) RegisterProxy

func (c *Control) RegisterProxy(conn conn.Conn)

func (*Control) Replaced

func (c *Control) Replaced(replacement *Control)

Called when this control is replaced by another control this can happen if the network drops out and the client reconnects before the old tunnel has lost its heartbeat

type ControlRegistry

type ControlRegistry struct {
	log.Logger
	sync.RWMutex
	// contains filtered or unexported fields
}

ControlRegistry maps a client ID to Control structures

func NewControlRegistry

func NewControlRegistry() *ControlRegistry

func (*ControlRegistry) Add

func (r *ControlRegistry) Add(clientId string, ctl *Control) (oldCtl *Control)

func (*ControlRegistry) Del

func (r *ControlRegistry) Del(clientId string) error

func (*ControlRegistry) Get

func (r *ControlRegistry) Get(clientId string) *Control

func (*ControlRegistry) IDs

func (r *ControlRegistry) IDs() (ids map[string]string)

Jump to

Keyboard shortcuts

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