local

package
v0.0.0-...-3386cd4 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2020 License: GPL-3.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRead        = errors.New("Reading pipe error")
	ErrWrite       = errors.New("Writing pipe error")
	ErrNoSignal    = errors.New("Signal timeout error")
	ErrSignalFalse = errors.New("Signal false")
)
View Source
var (
	ErrDeniedPort     = errors.New("try to access denied port")
	ErrNotAllowedPort = errors.New("try to access not allowed port")
	ErrDeniedIP       = errors.New("try to access denied IP")
	ErrNotAllowedIP   = errors.New("try to access not allowed IP")
	ErrLoopProxy      = errors.New("try to access proxy server")
)

Functions

func Main

func Main()

Main the entry of this program

func PipeInboundToOutbound

func PipeInboundToOutbound(pp pipeParam, buffer **common.Buffer) (result error)

func PipeOutboundToInbound

func PipeOutboundToInbound(pp pipeParam) (err error)

Types

type BackendInfo

type BackendInfo struct {
	HTTPSProxyInfo
	SSRInfo
	// contains filtered or unexported fields
}

BackendInfo all fields that a backend used

type BackendsInformation

type BackendsInformation []*BackendInfo

func (BackendsInformation) Len

func (slice BackendsInformation) Len() int

func (BackendsInformation) Swap

func (slice BackendsInformation) Swap(i, j int)

type BackendsInformationWrapper

type BackendsInformationWrapper struct {
	sync.RWMutex
	BackendsInformation
}

func NewBackendsInformationWrapper

func NewBackendsInformationWrapper() *BackendsInformationWrapper

func (*BackendsInformationWrapper) Append

func (biw *BackendsInformationWrapper) Append(bi *BackendInfo)

func (*BackendsInformationWrapper) Get

func (*BackendsInformationWrapper) Len

func (biw *BackendsInformationWrapper) Len() int

func (*BackendsInformationWrapper) Remove

func (biw *BackendsInformationWrapper) Remove(i int)

type ByFailedCount

type ByFailedCount struct{ BackendsInformation }

func (ByFailedCount) Less

func (slice ByFailedCount) Less(i, j int) bool

type ByHighestLastHourBps

type ByHighestLastHourBps struct{ BackendsInformation }

func (ByHighestLastHourBps) Less

func (slice ByHighestLastHourBps) Less(i, j int) bool

type ByHighestLastMinuteBps

type ByHighestLastMinuteBps struct{ BackendsInformation }

func (ByHighestLastMinuteBps) Less

func (slice ByHighestLastMinuteBps) Less(i, j int) bool

type ByHighestLastSecondBps

type ByHighestLastSecondBps struct{ BackendsInformation }

func (ByHighestLastSecondBps) Less

func (slice ByHighestLastSecondBps) Less(i, j int) bool

type ByHighestLastTenMinutesBps

type ByHighestLastTenMinutesBps struct{ BackendsInformation }

func (ByHighestLastTenMinutesBps) Less

func (slice ByHighestLastTenMinutesBps) Less(i, j int) bool

type ByLastHourBps

type ByLastHourBps struct{ BackendsInformation }

func (ByLastHourBps) Less

func (slice ByLastHourBps) Less(i, j int) bool

type ByLastMinuteBps

type ByLastMinuteBps struct{ BackendsInformation }

func (ByLastMinuteBps) Less

func (slice ByLastMinuteBps) Less(i, j int) bool

type ByLastSecondBps

type ByLastSecondBps struct{ BackendsInformation }

func (ByLastSecondBps) Less

func (slice ByLastSecondBps) Less(i, j int) bool

type ByLastTenMinutesBps

type ByLastTenMinutesBps struct{ BackendsInformation }

func (ByLastTenMinutesBps) Less

func (slice ByLastTenMinutesBps) Less(i, j int) bool

type ByLatency

type ByLatency struct{ BackendsInformation }

func (ByLatency) Less

func (slice ByLatency) Less(i, j int) bool

type ByTotalDownload

type ByTotalDownload struct{ BackendsInformation }

func (ByTotalDownload) Less

func (slice ByTotalDownload) Less(i, j int) bool

type ByTotalUpload

type ByTotalUpload struct{ BackendsInformation }

func (ByTotalUpload) Less

func (slice ByTotalUpload) Less(i, j int) bool

type CommonProxyInfo

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

CommonProxyInfo fields that auth for http/https/socks

type Connection

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

func (*Connection) SendMsg

func (c *Connection) SendMsg(cmd int, wParam string, lParam string)

type HTTPSProxyInfo

type HTTPSProxyInfo struct {
	CommonProxyInfo
	// contains filtered or unexported fields
}

HTTPSProxyInfo fields that https used only

type Report

type Report struct {
	Quote         int64
	TotalDownload uint64
	TotalUpload   uint64
	CurrentUsing  string
	StartAt       time.Time
	Uptime        string
	Stats
}

Report type for statistics report

type SSInfo

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

SSInfo fields that shadowsocks/shadowsocksr used only

type SSRInfo

type SSRInfo struct {
	SSInfo
	// contains filtered or unexported fields
}

SSRInfo fields that shadowsocksr used only

type Sorter

type Sorter func(string, Stats)

type Stat

type Stat struct {
	Id           string
	Address      string
	ProtocolType string
	FailedCount  uint32
	Latency      int64
	// contains filtered or unexported fields
}

type StatisticMap

type StatisticMap map[*BackendInfo]*common.Statistic

type StatisticWrapper

type StatisticWrapper struct {
	sync.RWMutex
	StatisticMap
}

func NewStatisticWrapper

func NewStatisticWrapper() *StatisticWrapper

func (*StatisticWrapper) Delete

func (m *StatisticWrapper) Delete(si *BackendInfo)

func (*StatisticWrapper) Get

func (m *StatisticWrapper) Get(bi *BackendInfo) (s *common.Statistic, ok bool)

func (*StatisticWrapper) Insert

func (m *StatisticWrapper) Insert(si *BackendInfo, s *common.Statistic)

func (*StatisticWrapper) LoadFromCache

func (m *StatisticWrapper) LoadFromCache()

func (*StatisticWrapper) SaveToRedis

func (m *StatisticWrapper) SaveToRedis()

func (*StatisticWrapper) UpdateBps

func (m *StatisticWrapper) UpdateBps()

func (*StatisticWrapper) UpdateLatency

func (m *StatisticWrapper) UpdateLatency()

func (*StatisticWrapper) UpdateServerIP

func (m *StatisticWrapper) UpdateServerIP()

type Stats

type Stats []*Stat

func (Stats) Len

func (slice Stats) Len() int

func (Stats) Less

func (slice Stats) Less(i, j int) bool

func (Stats) Swap

func (slice Stats) Swap(i, j int)

Jump to

Keyboard shortcuts

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