tunnel

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2018 License: MIT Imports: 13 Imported by: 90

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 Mode added in v0.5.0

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

func (Mode) MarshalJSON added in v0.10.0

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.10.0

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

UnmarshalJSON unserialize Mode

func (*Mode) UnmarshalYAML added in v0.10.0

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

UnmarshalYAML unserialize Mode with yaml

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 proxy socket and HTTP/SOCKS socket

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) Mode added in v0.10.0

func (t *Tunnel) Mode() Mode

Mode return current mode

func (*Tunnel) Proxies added in v0.10.0

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

Proxies return all proxies

func (*Tunnel) Rules added in v0.10.0

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) SetResolver added in v0.10.0

func (t *Tunnel) SetResolver(resolver *dns.Resolver)

SetResolver change the resolver of tunnel

func (*Tunnel) Traffic added in v0.4.0

func (t *Tunnel) Traffic() *C.Traffic

Traffic return traffic of all connections

func (*Tunnel) UpdateProxies added in v0.10.0

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

UpdateProxies handle update proxies

func (*Tunnel) UpdateRules added in v0.10.0

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