registry

package
v0.0.4-beta4 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpProps

type HttpProps struct {
	Host string
}

type HttpTunnelProperties

type HttpTunnelProperties struct {
	Host          string
	RemoteAddress string
}

type IHttpsTunnel

type IHttpsTunnel interface {
	Match(req http.Header) bool
	GetSession() *yamux.Session
	GetID() string
	GetProperties() (HttpTunnelProperties, error)
}

func NewHttpsTunnel

func NewHttpsTunnel() IHttpsTunnel

type ITlsTunnel

type ITlsTunnel interface {
	Match(clientHello *tls.ClientHelloInfo) bool
	GetSession() *yamux.Session
	GetID() string
	GetProperties() (TlsTunnelProperties, error)
}

func NewTlsTunnel

func NewTlsTunnel() ITlsTunnel

type ITunnel

type ITunnel interface {
	GetSession() *yamux.Session
	GetID() string
}

type InMemHttpsTunnel

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

func (InMemHttpsTunnel) GetID

func (t InMemHttpsTunnel) GetID() string

func (InMemHttpsTunnel) GetProperties

func (t InMemHttpsTunnel) GetProperties() (HttpTunnelProperties, error)

func (InMemHttpsTunnel) GetSession

func (t InMemHttpsTunnel) GetSession() *yamux.Session

func (InMemHttpsTunnel) Match

func (t InMemHttpsTunnel) Match(req http.Header) bool

type InMemTlsTunnel

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

func (InMemTlsTunnel) GetID

func (t InMemTlsTunnel) GetID() string

func (InMemTlsTunnel) GetProperties

func (t InMemTlsTunnel) GetProperties() (TlsTunnelProperties, error)

func (InMemTlsTunnel) GetSession

func (t InMemTlsTunnel) GetSession() *yamux.Session

func (InMemTlsTunnel) Match

func (t InMemTlsTunnel) Match(clientHello *tls.ClientHelloInfo) bool

type InMemTunnelRegistry

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

func (*InMemTunnelRegistry) GetHttpSession

func (i *InMemTunnelRegistry) GetHttpSession(req http.Header) (*yamux.Session, error)

func (*InMemTunnelRegistry) GetHttpTunnels

func (i *InMemTunnelRegistry) GetHttpTunnels() (map[string]IHttpsTunnel, error)

func (InMemTunnelRegistry) GetTLSSession

func (i InMemTunnelRegistry) GetTLSSession(clientHello *tls.ClientHelloInfo) (*yamux.Session, error)

func (*InMemTunnelRegistry) GetTLSTunnels

func (i *InMemTunnelRegistry) GetTLSTunnels() (map[string]ITlsTunnel, error)

func (InMemTunnelRegistry) RemoveSession

func (i InMemTunnelRegistry) RemoveSession(id string) error

func (InMemTunnelRegistry) StoreSession

func (i InMemTunnelRegistry) StoreSession(sess *yamux.Session) (ITunnel, error)

type PostgresHttpsTunnel

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

func (PostgresHttpsTunnel) GetID

func (t PostgresHttpsTunnel) GetID() string

func (PostgresHttpsTunnel) GetProperties

func (t PostgresHttpsTunnel) GetProperties() (HttpTunnelProperties, error)

func (PostgresHttpsTunnel) GetSession

func (t PostgresHttpsTunnel) GetSession() *yamux.Session

func (PostgresHttpsTunnel) Match

func (t PostgresHttpsTunnel) Match(req http.Header) bool

type PostgresTlsTunnel

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

func (PostgresTlsTunnel) GetID

func (t PostgresTlsTunnel) GetID() string

func (PostgresTlsTunnel) GetProperties

func (t PostgresTlsTunnel) GetProperties() (TlsTunnelProperties, error)

func (PostgresTlsTunnel) GetSession

func (t PostgresTlsTunnel) GetSession() *yamux.Session

func (PostgresTlsTunnel) Match

func (t PostgresTlsTunnel) Match(clientHello *tls.ClientHelloInfo) bool

type PostgresTunnelRegistry

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

func (*PostgresTunnelRegistry) GetHttpSession

func (r *PostgresTunnelRegistry) GetHttpSession(req http.Header) (*yamux.Session, error)

func (*PostgresTunnelRegistry) GetHttpTunnels

func (r *PostgresTunnelRegistry) GetHttpTunnels() (map[string]IHttpsTunnel, error)

func (*PostgresTunnelRegistry) GetTLSSession

func (r *PostgresTunnelRegistry) GetTLSSession(clientHello *tls.ClientHelloInfo) (*yamux.Session, error)

func (*PostgresTunnelRegistry) GetTLSTunnels

func (r *PostgresTunnelRegistry) GetTLSTunnels() (map[string]ITlsTunnel, error)

func (*PostgresTunnelRegistry) RemoveSession

func (r *PostgresTunnelRegistry) RemoveSession(id string) error

func (*PostgresTunnelRegistry) StoreSession

func (r *PostgresTunnelRegistry) StoreSession(
	sess *yamux.Session,
) (ITunnel, error)

type Protocol

type Protocol string
const (
	HttpProtocol Protocol = "http"
	TlsProtocol  Protocol = "tls"
)

type Session

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

type TlsProps

type TlsProps struct {
	Sni string
}

type TlsTunnelProperties

type TlsTunnelProperties struct {
	SNI           string
	RemoteAddress string
}

type Tunnel

type Tunnel interface {
	GetSession() *yamux.Session
	Match(req *http.Request, clientHello *tls.ClientHelloInfo) bool
}

type TunnelCtx

type TunnelCtx struct {
	DestConn        net.Conn
	Reader          *bufio.Reader
	Conn            net.Conn
	ClientHelloInfo *tls.ClientHelloInfo
}

type TunnelRegistry

type TunnelRegistry interface {
	RemoveSession(id string) error
	StoreSession(
		sess *yamux.Session,
	) (ITunnel, error)
	GetTLSSession(clientHello *tls.ClientHelloInfo) (*yamux.Session, error)
	GetHttpTunnels() (map[string]IHttpsTunnel, error)
	GetTLSTunnels() (map[string]ITlsTunnel, error)
	GetHttpSession(req http.Header) (*yamux.Session, error)
}

func NewInMemoryTunnelRegistry

func NewInMemoryTunnelRegistry() TunnelRegistry

func NewPostgresTunnelRegistry

func NewPostgresTunnelRegistry(db *gorm.DB) TunnelRegistry

Jump to

Keyboard shortcuts

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