tunnel

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2020 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ModeMapping is a mapping for Mode enum
	ModeMapping = map[string]Mode{
		Global.String(): Global,
		Rule.String():   Rule,
		Direct.String(): Direct,
	}
)

Functions

This section is empty.

Types

type Manager added in v0.16.4

type Manager struct {
	// contains filtered or unexported fields
}
var DefaultManager *Manager

func (*Manager) Download added in v0.16.4

func (m *Manager) Download() chan<- int64

func (*Manager) Join added in v0.16.4

func (m *Manager) Join(c tracker)

func (*Manager) Leave added in v0.16.4

func (m *Manager) Leave(c tracker)

func (*Manager) Now added in v0.16.4

func (m *Manager) Now() (up int64, down int64)

func (*Manager) Snapshot added in v0.16.4

func (m *Manager) Snapshot() *Snapshot

func (*Manager) Upload added in v0.16.4

func (m *Manager) Upload() chan<- int64

type Mode added in v0.5.0

type Mode int
const (
	Global Mode = iota
	Rule
	Direct
)

func (Mode) MarshalJSON added in v0.16.4

func (m Mode) MarshalJSON() ([]byte, error)

MarshalJSON serialize Mode

func (Mode) String added in v0.5.0

func (m Mode) String() string

func (*Mode) UnmarshalJSON added in v0.16.4

func (m *Mode) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON unserialize Mode

func (*Mode) UnmarshalYAML added in v0.16.4

func (m *Mode) UnmarshalYAML(unmarshal func(interface{}) error) (err error)

UnmarshalYAML unserialize Mode with yaml

type Snapshot added in v0.16.4

type Snapshot struct {
	DownloadTotal int64     `json:"downloadTotal"`
	UploadTotal   int64     `json:"uploadTotal"`
	Connections   []tracker `json:"connections"`
}

type TrafficTrack added in v0.6.0

type TrafficTrack struct {
	net.Conn
	// contains filtered or unexported fields
}

TrafficTrack record traffic of net.Conn

func (*TrafficTrack) Read added in v0.6.0

func (tt *TrafficTrack) Read(b []byte) (int, error)

func (*TrafficTrack) Write added in v0.6.0

func (tt *TrafficTrack) Write(b []byte) (int, error)

type Tunnel

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

Tunnel handle relay inbound proxy and outbound proxy

func Instance added in v0.6.0

func Instance() *Tunnel

Instance return singleton instance of Tunnel

func (*Tunnel) Add

func (t *Tunnel) Add(req C.ServerAdapter)

Add request to queue

func (*Tunnel) AddPacket added in v0.17.0

func (t *Tunnel) AddPacket(packet *inbound.PacketAdapter)

AddPacket add udp Packet to queue

func (*Tunnel) Mode added in v0.16.4

func (t *Tunnel) Mode() Mode

Mode return current mode

func (*Tunnel) Providers added in v0.16.4

func (t *Tunnel) Providers() map[string]provider.ProxyProvider

Providers return all compatible providers

func (*Tunnel) Proxies added in v0.16.4

func (t *Tunnel) Proxies() map[string]C.Proxy

Proxies return all proxies

func (*Tunnel) Rules added in v0.16.4

func (t *Tunnel) Rules() []C.Rule

Rules return all rules

func (*Tunnel) SetMode added in v0.5.0

func (t *Tunnel) SetMode(mode Mode)

SetMode change the mode of tunnel

func (*Tunnel) UpdateExperimental added in v0.16.4

func (t *Tunnel) UpdateExperimental(ignoreResolveFail bool)

UpdateExperimental handle update experimental config

func (*Tunnel) UpdateProxies added in v0.16.4

func (t *Tunnel) UpdateProxies(proxies map[string]C.Proxy, providers map[string]provider.ProxyProvider)

UpdateProxies handle update proxies

func (*Tunnel) UpdateRules added in v0.16.4

func (t *Tunnel) UpdateRules(rules []C.Rule)

UpdateRules handle update rules

Jump to

Keyboard shortcuts

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