tun

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TunRegistry added in v0.6.3

func TunRegistry() *registry.Registry

TunRegistry returns a singleton instance of Registry

Types

type Tunnel

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

Tunnel object

func NewTunnel

func NewTunnel(sshConn *sshc.SshConnection, conf *TunnelConf, stoppable bool) *Tunnel

NewTunnel builds a Tunnel object

func (*Tunnel) GetActiveClientsCount added in v0.6.3

func (t *Tunnel) GetActiveClientsCount() int

GetActiveClientsCount returns how many clients are actually using the tunnel

func (*Tunnel) GetCurrentBytesPerSecond added in v0.9.0

func (t *Tunnel) GetCurrentBytesPerSecond() int64

GetsCurrentBytesPerSecond return the current tunnel throughput

func (*Tunnel) GetEndpoint added in v0.6.3

func (t *Tunnel) GetEndpoint() utils.Endpoint

GetEndpoint returns the tunnel endpoint

func (*Tunnel) GetIsListenerLocal added in v0.6.3

func (t *Tunnel) GetIsListenerLocal() bool

GetIsListenerLocal return true if it is a forward tunnel. In a forward tunnel a socket listener is started on the local (rospo) machine and all the connections are forwarded to the remote endpoint. In a NON forward tunnel, the listener is started on the remote machine instead. When a client connects to the remote listener the connection is forwarded on the local endpoint

func (*Tunnel) GetListenerAddr added in v0.6.3

func (t *Tunnel) GetListenerAddr() net.Addr

GetListenerAddr returns the tunnel listener network address

func (*Tunnel) IsStoppable added in v0.6.3

func (t *Tunnel) IsStoppable() bool

IsStoppable return true if the tunnel can be stopped calling the Stop method. False if not

func (*Tunnel) Start

func (t *Tunnel) Start()

Start activates the tunnel connections

func (*Tunnel) Stop added in v0.6.3

func (t *Tunnel) Stop()

Stop ends the tunnel

type TunnelConf added in v0.6.3

type TunnelConf struct {
	//// Tunnel conf
	Remote string `yaml:"remote" json:"remote"`
	Local  string `yaml:"local" json:"local"`
	// indicates if it is a forward or reverse tunnel
	Forward bool `yaml:"forward" json:"forward"`
	// use a dedicated ssh client. if nil use the global one
	SshClientConf *sshc.SshClientConf `yaml:"sshclient" json:"sshclient"`
}

TunnelConf is a struct that holds the tunnel configuration

func (*TunnelConf) GetLocalEndpoint added in v0.6.3

func (c *TunnelConf) GetLocalEndpoint() *utils.Endpoint

GetLocalEndpoint Builds a locale endpoint object from the Local string

func (*TunnelConf) GetRemotEndpoint added in v0.6.3

func (c *TunnelConf) GetRemotEndpoint() *utils.Endpoint

GetRemotEndpoint Builds a remote endpoint object from the Remote string

Jump to

Keyboard shortcuts

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