registry

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2018 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	IP       string
	Domain   string
	HTTPAddr string
	Timeout  util.TimeoutConfig
}

type HTTPTunnel

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

func NewHTTPTunnel

func NewHTTPTunnel(tracker *tracker.TunnelTracker, l net.Listener) *HTTPTunnel

func (HTTPTunnel) Close

func (tt HTTPTunnel) Close()

Close closes the listener and set the closed flag, then no more new requests could be processed.

func (HTTPTunnel) NewSession

func (tt HTTPTunnel) NewSession(conn net.Conn) bool

func (HTTPTunnel) Serve

func (tt HTTPTunnel) Serve() error

func (HTTPTunnel) WaitAndCleanup

func (tt HTTPTunnel) WaitAndCleanup()

WaitAndCleanup wait in processing requests done then closes the session, since all streams will be closed if session closed.

type HTTPTunnelMuxer

type HTTPTunnelMuxer struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewHTTPTunnelMuxer

func NewHTTPTunnelMuxer(domain string, addr string) (*HTTPTunnelMuxer, error)

func (*HTTPTunnelMuxer) Close

func (hm *HTTPTunnelMuxer) Close() error

func (*HTTPTunnelMuxer) Listen

func (hm *HTTPTunnelMuxer) Listen(subdomain string) (*httpConnListener, error)

func (*HTTPTunnelMuxer) Serve

func (hm *HTTPTunnelMuxer) Serve() error

type TCPTunnel

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

func NewTCPTunnel

func NewTCPTunnel(tracker *tracker.TunnelTracker, serverAddr string) (*TCPTunnel, error)

func (TCPTunnel) Close

func (tt TCPTunnel) Close()

Close closes the listener and set the closed flag, then no more new requests could be processed.

func (TCPTunnel) NewSession

func (tt TCPTunnel) NewSession(conn net.Conn) bool

func (TCPTunnel) Serve

func (tt TCPTunnel) Serve() error

func (TCPTunnel) WaitAndCleanup

func (tt TCPTunnel) WaitAndCleanup()

WaitAndCleanup wait in processing requests done then closes the session, since all streams will be closed if session closed.

type TCPTunnelRegistry

type TCPTunnelRegistry struct {
	sync.RWMutex
	sync.WaitGroup
	// contains filtered or unexported fields
}

func New

func New(conf Config) (*TCPTunnelRegistry, error)

func (*TCPTunnelRegistry) Close

func (tr *TCPTunnelRegistry) Close()

func (*TCPTunnelRegistry) Deregister

func (tr *TCPTunnelRegistry) Deregister(ahash, thash string) bool

func (*TCPTunnelRegistry) DeregisterAll

func (tr *TCPTunnelRegistry) DeregisterAll(ahash string) bool

func (*TCPTunnelRegistry) ListenAddr

func (tr *TCPTunnelRegistry) ListenAddr() string

func (*TCPTunnelRegistry) Register

func (tr *TCPTunnelRegistry) Register(tracker *tracker.TunnelTracker, proto, serverAddr string) error

func (*TCPTunnelRegistry) Serve

func (tr *TCPTunnelRegistry) Serve() error

func (*TCPTunnelRegistry) WaitDone

func (tr *TCPTunnelRegistry) WaitDone()

type Tunnel

type Tunnel interface {
	NewSession(conn net.Conn) bool
	Serve() error
	Close()
	WaitAndCleanup()
}

Jump to

Keyboard shortcuts

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