tunnel

package
v0.0.0-...-a94ae77 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRetry = errors.New("Error sending request, please retry")

ErrRetry Error when sending request

VV Used for versioning build

Functions

func SetVV

func SetVV(vv string)

SetVV Used for versioning build

func SimpleFormat

func SimpleFormat(timestamps bool) log15.Format

SimpleFormat used to determine whether or not timestamps are added

Types

type WSConnection

type WSConnection struct {
	Log log15.Logger // logger with "ws=0x1234"
	// contains filtered or unexported fields
}

WSConnection represents a single websocket connection

type WSTunnelClient

type WSTunnelClient struct {
	Token          string         // Rendez-vous token
	Tunnel         *url.URL       // websocket server to connect to (ws[s]://hostname:port)
	Server         string         // local HTTP(S) server to send received requests to (default server)
	InternalServer http.Handler   // internal Server to dispatch HTTP requests to
	Regexp         *regexp.Regexp // regexp for allowed local HTTP(S) servers
	Insecure       bool           // accept self-signed SSL certs from local HTTPS servers
	Cert           string         // accept provided certificate from local HTTPS servers
	Timeout        time.Duration  // timeout on websocket
	Proxy          *url.URL       // if non-nil, external proxy to use
	Log            log15.Logger   // logger with "pkg=WStuncli"
	StatusFd       *os.File       // output periodic tunnel status information
	Connected      bool           // true when we have an active connection to wstunsrv

	ClientPorts []int // array of ports for client to listen on.
	// contains filtered or unexported fields
}

WSTunnelClient represents a persistent tunnel that can cycle through many websockets. The fields in this struct are relatively static/constant. The conn field points to the latest websocket, but it's important to realize that there may be goroutines handling older websockets that are not fully closed yet running at any point in time

func NewWSTunnelClient

func NewWSTunnelClient(args []string) *WSTunnelClient

NewWSTunnelClient Creates a new WSTunnelClient from command line

func (*WSTunnelClient) Start

func (t *WSTunnelClient) Start() error

Start creates the wstunnel connection.

func (*WSTunnelClient) Stop

func (t *WSTunnelClient) Stop()

Stop closes the wstunnel channel

type WSTunnelServer

type WSTunnelServer struct {
	Port        int           // port to listen on
	Host        string        // host to listen on
	WSTimeout   time.Duration // timeout on websockets
	HTTPTimeout time.Duration // timeout for HTTP requests
	Log         log15.Logger  // logger with "pkg=WStunsrv"
	// contains filtered or unexported fields
}

WSTunnelServer a wstunnel server construct

func NewWSTunnelServer

func NewWSTunnelServer(args []string) *WSTunnelServer

NewWSTunnelServer function to create wstunnel from cli

func (*WSTunnelServer) Start

func (t *WSTunnelServer) Start(listener net.Listener)

Start wstunnel server start

func (*WSTunnelServer) Stop

func (t *WSTunnelServer) Stop()

Stop wstunnelserver stop

Jump to

Keyboard shortcuts

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