tunnel

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var XTunnelHead = []byte("X-TUNNEL")

Functions

func SetLogLevel

func SetLogLevel(level string)

func SetLogger

func SetLogger(l *logger.Logger)

Types

type Client

type Client struct {
	Server      string
	Tunnel      Tunnel
	ForwardPort uint16
}

func (*Client) Connect

func (client *Client) Connect()

type Server

type Server struct {
	Port uint16 // tunnel service port
	// contains filtered or unexported fields
}

func (*Server) ActivateTunnel

func (s *Server) ActivateTunnel(name string, port uint16, maxProxyLifetime int) *Tunnel

func (*Server) Serve

func (s *Server) Serve() (err error)

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Tunnel

type Tunnel struct {
	Name             string
	Port             uint16
	MaxProxyLifetime int
	// contains filtered or unexported fields
}

func (*Tunnel) ListenAndServe

func (t *Tunnel) ListenAndServe() (err error)

type TunnelInfo added in v0.4.0

type TunnelInfo struct {
	Name             string `json:"name"`
	Port             uint16 `json:"port"`
	MaxProxyLifetime int    `json:"maxProxyLifetime,omitempty"`
	Online           bool   `json:"online"`
	ClientAddr       string `json:"clientAddr"`
	ProxyConnections int    `json:"proxyConnections"`
}

type TunnelSlice added in v0.4.0

type TunnelSlice []TunnelInfo

func (TunnelSlice) Len added in v0.4.0

func (p TunnelSlice) Len() int

func (TunnelSlice) Less added in v0.4.0

func (p TunnelSlice) Less(i, j int) bool

func (TunnelSlice) Swap added in v0.4.0

func (p TunnelSlice) Swap(i, j int)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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