flora

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2017 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServerTypeShadowSocks = "shadowsocks"
	ServerTypeCustom      = "custom"
	ServerTypeHttp        = "http"
	ServerTypeHttps       = "https"
	ServerTypeDirect      = "direct"
	ServerTypeReject      = "direct"

	LocalServerSocksV5 = "localSocksv5"
	LocalServerHttp    = "localHttp"
)
View Source
const (
	DEFAULT_SOCKS_PORT = 1080
)

Variables

This section is empty.

Functions

func GeoIP

func GeoIP(ip net.IP) string

func GeoIPString

func GeoIPString(ipaddr string) string

func GeoIPs

func GeoIPs(ips []net.IP) string

func Run added in v0.2.3

func Run(surgeCfg, geoipCfg string)

Types

type DirectServer added in v0.2.3

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

func NewDirect added in v0.2.3

func NewDirect() *DirectServer

func (*DirectServer) AddFail added in v0.2.3

func (s *DirectServer) AddFail()

func (*DirectServer) DialWithRawAddr added in v0.2.3

func (s *DirectServer) DialWithRawAddr(raw []byte, host string) (remote net.Conn, err error)

func (*DirectServer) FailCount added in v0.2.3

func (s *DirectServer) FailCount() int

func (*DirectServer) ProxyType added in v0.2.3

func (s *DirectServer) ProxyType() string

func (*DirectServer) ResetFailCount added in v0.2.3

func (s *DirectServer) ResetFailCount()

type ProxyConfig

type ProxyConfig struct {
	SurgeConfig    *ini.File
	GeoDbPath      string
	LocalSocksPort int
	LocalHost      string
	// contains filtered or unexported fields
}

func LoadConfig

func LoadConfig(cfgFile string, geoFile string) *ProxyConfig

func (*ProxyConfig) GetProxyServer added in v0.2.3

func (c *ProxyConfig) GetProxyServer(action string) ProxyServer

type ProxyServer added in v0.2.3

type ProxyServer interface {
	//proxy type
	ProxyType() string
	//dial
	DialWithRawAddr(raw []byte, host string) (remote net.Conn, err error)
	//
	FailCount() int

	AddFail()
	//
	ResetFailCount()
}

type Reject added in v0.2.3

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

func NewReject added in v0.2.3

func NewReject() *Reject

func (*Reject) AddFail added in v0.2.3

func (s *Reject) AddFail()

func (*Reject) DialWithRawAddr added in v0.2.3

func (s *Reject) DialWithRawAddr(raw []byte, host string) (remote net.Conn, err error)

func (*Reject) FailCount added in v0.2.3

func (s *Reject) FailCount() int

func (*Reject) ProxyType added in v0.2.3

func (s *Reject) ProxyType() string

func (*Reject) ResetFailCount added in v0.2.3

func (s *Reject) ResetFailCount()

type Rule added in v0.2.3

type Rule struct {
	Match  string
	Action string
}

type ShadowSocksServer added in v0.2.3

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

func NewShadowSocks added in v0.2.3

func NewShadowSocks(server string, cipher *ss.Cipher) *ShadowSocksServer

func (*ShadowSocksServer) AddFail added in v0.2.3

func (s *ShadowSocksServer) AddFail()

func (*ShadowSocksServer) DialWithRawAddr added in v0.2.3

func (s *ShadowSocksServer) DialWithRawAddr(raw []byte, host string) (net.Conn, error)

func (*ShadowSocksServer) FailCount added in v0.2.3

func (s *ShadowSocksServer) FailCount() int

func (*ShadowSocksServer) ProxyType added in v0.2.3

func (s *ShadowSocksServer) ProxyType() string

func (*ShadowSocksServer) ResetFailCount added in v0.2.3

func (s *ShadowSocksServer) ResetFailCount()

type SystemProxySettings added in v0.2.6

type SystemProxySettings interface {
	TurnOnGlobProxy()
	TurnOffGlobProxy()
}

Jump to

Keyboard shortcuts

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