tcp

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnauthorizedKey = errors.New("unauthorized key")

ErrUnauthorizedKey is returned when a key is not authorized.

View Source
var ErrUnauthorizedPort = errors.New("unauthorized port")

ErrUnauthorizedPort is returned when a key is not allowed to bind to a requested port.

Functions

This section is empty.

Types

type Binder

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

Binder implements service.Binder for TCP tunneling service.

func (Binder) Start

func (binder Binder) Start(ws *websocket.Conn, store *service.SessionStore) error

Start binds to a TCP port and creates tcp.Session for each client connection.

type Service

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

Service implements service.Service for TCP tunneling service.

func NewService

func NewService(conf config.Server) Service

NewService creates a tcp.Service with given server configuration.

func (Service) GetBinder

func (serv Service) GetBinder(key string, port int) (service.Binder, error)

GetBinder returns a tcp.Binder for an agent with given authorization key and given TCP port.

type Session

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

Session implements service.Session for TCP tunneling.

func NewSession

func NewSession(conn *net.TCPConn) *Session

NewSession creates a Session for tunneling given TCP connection.

func (Session) Close

func (sess Session) Close() error

Close closes client connection.

func (Session) PeerAddr

func (sess Session) PeerAddr() net.Addr

PeerAddr returns the address of the connected client.

func (Session) Start

func (sess Session) Start(ws *websocket.Conn) error

Start starts tunneling TCP packets through given websocket channel.

Jump to

Keyboard shortcuts

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