server

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: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidKey = errors.New("invalid auth key")

ErrInvalidKey is returned when an authorization is is invalid or does not have sufficient privilege.

View Source
var ErrInvalidPort = errors.New("invalid port number")

ErrInvalidPort is returned when

View Source
var ErrInvalidSessionID = errors.New("invalid session ID")

ErrInvalidSessionID is returned when a requested session ID is not found.

View Source
var ErrMissingKey = errors.New("missing auth key")

ErrMissingKey is returned when a request to an privileged resource does not contain an authorization key.

Functions

func Error

func Error(c echo.Context, err error) error

Error responds to client with an error. The error is logged and translated to proper HTTP status response.

func Start

func Start(conf config.Server) error

Start starts tunneling server with given configuration.

func WebSocket

func WebSocket(c echo.Context, handler func(ws *websocket.Conn) error) error

WebSocket starts websocket session. The handler is invoked in a goroutine.

Types

type Action

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

Action takes HTTP requests and serves tunneling service.

func NewAction

func NewAction(conf config.Server) Action

NewAction creates a new Action with given server configuration.

func (*Action) GetServicePort

func (action *Action) GetServicePort(c echo.Context, serv service.Service) error

GetServicePort handles port binding request, backed by given service.

func (*Action) GetSession

func (action *Action) GetSession(c echo.Context) error

GetSession handles GET /session/:id request.

func (*Action) GetTCPPort

func (action *Action) GetTCPPort(c echo.Context) error

GetTCPPort handles GET /tcp/:port request, backed by tcp.Binder.

func (*Action) GetUDPPort

func (action *Action) GetUDPPort(c echo.Context) error

GetUDPPort handles GET /udp/:port request, backed by udp.Binder.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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