Documentation ¶
Index ¶
- Constants
- Variables
- func ColorD(args interface{}, join ...string)
- func ColorE(args ...interface{})
- func ColorL(args ...interface{})
- func ColorM(args ...interface{})
- func Copy(dst io.Writer, src io.Reader) (written int64, err error)
- func CreateCertificate(serverHost string, isCA bool) (configUri, base string)
- func Credient(username, password string) (routeDir string, err error)
- func DeepCopy(dst interface{}, src interface{})
- func DialWithRawAddr(rawaddr []byte, server string) (conn net.Conn, err error)
- func DownloadFile(filepath string, url string) error
- func GbkToUtf8(s []byte) ([]byte, error)
- func GenerateConfigJsons(dstRoot string) (err error)
- func GetLocalRequest(conn *net.Conn) (rawaddr []byte, host string, isUdp bool, err error)
- func GetLocalRequestUDP(conn *net.Conn) (rawaddr []byte, host string, err error)
- func GetMainDomain(urlOrHost string) string
- func GetOldSpeedMap(filepath string) (out map[string][]ConfigSpeed)
- func GetSSServerRequest(conn net.Conn) (host string, raw []byte, isUdp bool, err error)
- func GetServerRequest(conn net.Conn) (host string, raw []byte, isUdp bool, err error)
- func HostToRaw(host string, port int) (raw []byte)
- func IsDir(path string) bool
- func KillProcess() (err error)
- func LogCopy(src, dst net.Conn)
- func Md5Str(buf []byte) string
- func ParseUDPSocks5(buf []byte) (host string, rawaddr []byte, err error)
- func PathExists(path string) bool
- func Pipe(p1, p2 net.Conn) (err error)
- func PipeThenClose(src, dst CanCopy)
- func SendSpeedMsg(ip string, usage int64, speed float64)
- func SetConfigS(config *Config, addr string) (err error)
- func SetDebug(d DebugLog)
- func SetKcpReadTimeout(c *kcp.UDPSession)
- func SetReadTimeout(c *net.Conn)
- func SetStreamReadTimeout(c *smux.Stream)
- func Socks5HandShake(conn *net.Conn) (err error)
- func SpeedShow()
- func Stat(cmd string, s bool)
- func Sync(configRoot string) (file string, err error)
- func Tcp2Kcp(src, dst io.ReadWriteCloser)
- func Unzip(src string, dest string) ([]string, error)
- func UpdateConfig(old, new *Config)
- func Utf8ToGbk(s []byte) ([]byte, error)
- type AddrSpec
- type Book
- func (book *Book) Add(ssuri string) (s string, err error)
- func (book *Book) Books() (cons []Config)
- func (book *Book) Count() int
- func (book *Book) FlowGet() (config *Config)
- func (book *Book) Get(server ...string) (config *Config)
- func (book *Book) GetServers() (s []string)
- func (book *Book) Info() (cs []string, err error)
- func (book *Book) Ls() (cs []string, err error)
- func (book *Book) RandGet(server ...string) (config *Config)
- func (book *Book) Scan(dirs ...string) (dirErr error)
- type CanCopy
- type CanDeadLine
- type Config
- func (config *Config) GeneratePassword(plugin ...string) (en kcp.BlockCrypt)
- func (config *Config) GetBook(key string) (book *Config)
- func (config *Config) GetBookByID(id uint16) (book *Config)
- func (config *Config) GetServerArray() []string
- func (config *Config) ToFile(dst string) (err error)
- func (config *Config) ToJson() string
- func (config *Config) ToString() string
- func (config *Config) ToTlsConfig() (tlsConfig *TlsConfig, err error)
- func (config *Config) ToUri() string
- type ConfigSpeed
- type DNSResolver
- type DebugLog
- type KcpBase
- func (kcpBase *KcpBase) Activate(do_some func() error) error
- func (kcpBase *KcpBase) AddAlive()
- func (kcpBase *KcpBase) AddReverseCon()
- func (kcpBase *KcpBase) DelReverseCon()
- func (kcpBase *KcpBase) GetActivateConn() int
- func (kcpBase *KcpBase) GetAliveNum() int
- func (kcpBase *KcpBase) GetAliveReverseCon() int
- func (kcpBase *KcpBase) GetConfig() *Config
- func (kcpBase *KcpBase) GetKcpConfig() *KcpConfig
- func (kcpBase *KcpBase) GetRefreshRate() time.Duration
- func (kcpBase *KcpBase) GetSession(idx uint16) (session *smux.Session)
- func (kcpBase *KcpBase) GetSmuxConfig() *smux.Config
- func (s *KcpBase) HandleUDP(udpConn *net.UDPConn)
- func (kcpBase *KcpBase) HeartBeatC(stream net.Conn)
- func (kcpBase *KcpBase) HeartBeatS(stream net.Conn, fromHost string, clearAfter func(h string))
- func (kcp *KcpBase) HiddenConnListener()
- func (kcp *KcpBase) HiidenConfig(con net.Conn)
- func (kcpBase *KcpBase) Init(config *Config)
- func (serv *KcpBase) ListenUDP(ip string, port int)
- func (kcpBase *KcpBase) Pipe(p1, p2 net.Conn)
- func (kcpBase *KcpBase) ReConnection() (session *smux.Session, err error)
- func (kcpBase *KcpBase) RecvMsg(filter ...string) (pre string, content string)
- func (kcpBase *KcpBase) SendMsg(pre string, content string)
- func (kcpBase *KcpBase) SetConfig(config *Config)
- func (kcpBase *KcpBase) SetKcpConfig(config *KcpConfig)
- func (kcp *KcpBase) SetRedirectIRC(man *remote.ApiServerMan, ip string)
- func (kcpBase *KcpBase) SetRefreshRate(interval int)
- func (kcpBase *KcpBase) SetTunnelNum(n int) int
- func (kcpBase *KcpBase) ShowConfig()
- func (kcpBase *KcpBase) UpdateConfig(uri string)
- func (kcpBase *KcpBase) UpdateKcpConfig(kcpconn *kcp.UDPSession)
- func (kcpBase *KcpBase) WaitConn(config *Config) *smux.Session
- func (kcpBase *KcpBase) WithSession(config *Config, id ...uint16) (session *smux.Session)
- func (kcpBase *KcpBase) WithTestSession(config *Config, howTo func(sess *smux.Session))
- type KcpConfig
- type LeakyBuf
- type NameResolver
- type Route
- func (route *Route) GetConfig() *Config
- func (route *Route) Host() string
- func (route *Route) IfNoExpired() bool
- func (route *Route) Left() int
- func (route *Route) Mode() string
- func (route *Route) SetConfig(config *Config)
- func (route *Route) SetExireTime(sec int)
- func (route *Route) SetMode(mode string)
- type SpeedBar
- type SpeedTest
- func (test *SpeedTest) FlowMode() (output string, err error)
- func (test *SpeedTest) GetHistoryUrls() (history []string, err error)
- func (test *SpeedTest) GetNow() (out map[string]string, err error)
- func (test *SpeedTest) LsConfig() (output map[string]string, err error)
- func (test *SpeedTest) LsRoute() (out string, err error)
- func (test *SpeedTest) LsStop() (out string, err error)
- func (test *SpeedTest) SetConfig(config *Config) (err error)
- func (test *SpeedTest) SetRoute(uri ...string) (output string, err error)
- func (test *SpeedTest) ShowConfig(ip string) (output string, err error)
- func (test *SpeedTest) TestAllConfigs(howTest func(proaxyaddr string, config Config))
- func (test *SpeedTest) TestOneConfig(config *Config, addr string)
- func (test *SpeedTest) TestSpeed(urls []string, dirs ...string) (out map[string][]ConfigSpeed)
- type Statistic
- type TlsConfig
- type UrlSpeed
Constants ¶
const ( AddressIPv4 = 1 // type is ipv4 address AddressDomainName = 3 // type is domain address AddressIPv6 = 4 // type is ipv6 address )
const (
AddrMask byte = 0xf
)
const DEFAULT_TIMEOUT = 86400
const (
NORMAL_SCAN_DIR = "/etc/shadowsocks/:/tmp/_configs/"
)
Variables ¶
var ( ProxyAddr = "127.0.0.1:1091" TestProxyAddr = "127.0.0.1:40086" RouteIsBroken = errors.New("Route is broken. can not connect to outer world!") SocksConnectBroken = errors.New("Socks5 connect Error!") )
var ( TODAY time.Time = time.Now() BOOK Book = Book{ // contains filtered or unexported fields } HOME, _ = os.UserHomeDir() NORMAL_OPTIMISE_FILE = filepath.Join(HOME, "Desktop", "route.map.json") NORMAL_CONFIG_ROOT = filepath.Join(HOME, "Desktop", "routes") SALT = "demo salt" CRY_LEN = 4096 )
var AutoMap map[string][]ConfigSpeed
var BGCOLORS = []func(a ...interface{}) string{ color.New(color.BgYellow, color.Bold).SprintFunc(), color.New(color.BgRed, color.Bold).SprintFunc(), color.New(color.BgGreen, color.Bold).SprintFunc(), color.New(color.BgBlue, color.Bold).SprintFunc(), }
var (
DEFAULT_RESOLEVER = DNSResolver{}
)
var END_BYTES = []byte{91, 91, 69, 79, 70, 93, 93}
var ErrUDPFragmentNoSupported = errors.New("")
ErrUDPFragmentNoSupported UDP fragments not supported error
var FGCOLORS = []func(a ...interface{}) string{ color.New(color.FgYellow, color.Bold).SprintFunc(), color.New(color.FgRed, color.Bold).SprintFunc(), color.New(color.FgGreen, color.Bold).SprintFunc(), color.New(color.FgBlue, color.Bold).SprintFunc(), }
var GloballeakyBuf = NewLeakyBuf(maxNBuf, leakyBufSize)
var (
IconData []byte = []byte{}/* 188410 elements not displayed */
)
var ( // PASWD = "dGxzOi0tLS0tQkVHSU4gQ0VSVElGSUNBVEUtLS0tLQpNSUlFbVRDQ0E0R2dBd0lCQWdLQ0FR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CtGbEpaWk5kcGczWVVUR0t6cXhGTVpLOVRjNzdnelMKRDV6VWVTQlBhamZiTVJmVHRsZkp2MmhBTEFBeEFWc3FMS3MzVkZPNDM2dGZyVFpQRlZNYWZpRU9OWkFLZ3VxaQpYcFY1OU5DTFdsN1RBUVFSWFRSZDdPNXIKLS0tLS1FTkQgUFJJVkFURSBLRVktLS0tLQpAMTI3LjAuMC4xOjEyMzQ1" PASWD = "" /* 4564-byte string literal not displayed */ )
var SpeedMsgCHANNEL = make(chan Statistic, 30)
var (
Tmp = os.TempDir()
)
Functions ¶
func CreateCertificate ¶
func Credient ¶
will donwload file from your git://github.com/${name}/pro/config.en name : name/pro password will decrypt config
func DialWithRawAddr ¶
DialWithRawAddr is intended for use by users implementing a local socks proxy. rawaddr shoud contain part of the data in socks request, starting from the ATYP field. (Refer to rfc1928 for more information.)
func DownloadFile ¶
DownloadFile will download a url to a local file. It's efficient because it will write as it downloads and not load the whole file into memory.
func GenerateConfigJsons ¶
func GetLocalRequest ¶
func GetLocalRequestUDP ¶
func GetMainDomain ¶
func GetOldSpeedMap ¶
func GetOldSpeedMap(filepath string) (out map[string][]ConfigSpeed)
func GetSSServerRequest ¶
func GetServerRequest ¶
func HostToRaw ¶
func SetRTimeout(c io.Reader) { if readTimeout != 0 { c.SetReadDeadline(time.Now().Add(readTimeout)) } }
func KillProcess ¶
func KillProcess() (err error)
func PathExists ¶
func PipeThenClose ¶
func PipeThenClose(src, dst CanCopy)
func SendSpeedMsg ¶
func SetConfigS ¶
func SetKcpReadTimeout ¶
func SetKcpReadTimeout(c *kcp.UDPSession)
func SetReadTimeout ¶
func SetStreamReadTimeout ¶
func Socks5HandShake ¶
func Tcp2Kcp ¶
func Tcp2Kcp(src, dst io.ReadWriteCloser)
func Unzip ¶
Unzip will decompress a zip archive, moving all files and folders within the zip file (parameter 1) to an output directory (parameter 2).
func UpdateConfig ¶
func UpdateConfig(old, new *Config)
UpdateConfig : Useful for command line to override options specified in config file Debug is not updated.
Types ¶
type AddrSpec ¶
AddrSpec is used to return the target AddrSpec which may be specified as IPv4, IPv6, or a FQDN
type Book ¶
type Book struct {
// contains filtered or unexported fields
}
func (*Book) GetServers ¶
type CanDeadLine ¶
type Config ¶
type Config struct { Server interface{} `json:"server"` ServerPort int `json:"server_port"` LocalPort int `json:"local_port"` LocalAddress string `json:"local_address"` Password string `json:"password"` Method string `json:"method"` // encryption method // following options are only used by server PortPassword map[string]string `json:"port_password"` Timeout int `json:"timeout"` // The order of servers in the client config is significant, so use array // instead of map to preserve the order. ServerPassword string `json:"server_password"` // shadowsocks options SSPassword string `json:"ss_password"` OldSSPwd string `json:"ss_old"` SSMethod string `json:"ss_method"` SALT string `json:"salt"` EBUFLEN int `json:"buflen"` }
Config can use file to load
func ParseConfig ¶
ParseConfig parse path to json
func (*Config) GeneratePassword ¶
GeneratePassword by config
func (*Config) GetBookByID ¶
GetBookByID return a book from BOOK
func (*Config) GetServerArray ¶
GetServerArray get server
func (*Config) ToTlsConfig ¶
type ConfigSpeed ¶
func TestURLUsedTime ¶
func TestURLUsedTime(requrl, host string) ConfigSpeed
type KcpBase ¶
type KcpBase struct { Numconn int IsHeartBeat bool Role string Messages chan string IfCompress bool Plugin string RedirectBooks map[string]*Route // contains filtered or unexported fields }
func (*KcpBase) AddReverseCon ¶
func (kcpBase *KcpBase) AddReverseCon()
func (*KcpBase) DelReverseCon ¶
func (kcpBase *KcpBase) DelReverseCon()
func (*KcpBase) GetActivateConn ¶
func (*KcpBase) GetAliveNum ¶
func (*KcpBase) GetAliveReverseCon ¶
func (*KcpBase) GetKcpConfig ¶
func (*KcpBase) GetRefreshRate ¶
func (*KcpBase) GetSmuxConfig ¶
func (*KcpBase) HeartBeatC ¶
func (*KcpBase) HeartBeatS ¶
func (*KcpBase) HiddenConnListener ¶
func (kcp *KcpBase) HiddenConnListener()
func (*KcpBase) HiidenConfig ¶
func (*KcpBase) ReConnection ¶
func (*KcpBase) SetKcpConfig ¶
func (*KcpBase) SetRedirectIRC ¶
func (kcp *KcpBase) SetRedirectIRC(man *remote.ApiServerMan, ip string)
func (*KcpBase) SetRefreshRate ¶
func (*KcpBase) SetTunnelNum ¶
func (*KcpBase) ShowConfig ¶
func (kcpBase *KcpBase) ShowConfig()
func (*KcpBase) UpdateConfig ¶
func (*KcpBase) UpdateKcpConfig ¶
func (kcpBase *KcpBase) UpdateKcpConfig(kcpconn *kcp.UDPSession)
func (*KcpBase) WithSession ¶
type KcpConfig ¶
type KcpConfig struct { Mode string `json:"mode"` NoDelay int `json:"nodelay"` Interval int `json:"interval"` Resend int `json:"resend"` NoCongestion int `json:"nocongeestion"` AutoExpire int `json:"autoexpire"` ScavengeTTL int `json:"scavengettl"` MTU int `json:"mtu"` SndWnd int `json:"sndwnd"` RcvWnd int `json:"rcvwnd"` DataShard int `json:"datashard"` ParityShard int `json:"parityshard"` KeepAlive int `json:"keepalive"` SmuxBuf int `json:"smuxbuf"` StreamBuf int `json:"streambuf"` AckNodelay bool `json:"acknodelay"` SocketBuf int `json:"socketbuf"` }
func (*KcpConfig) GenerateConfig ¶
func (*KcpConfig) SetAsDefault ¶
func (kconfig *KcpConfig) SetAsDefault()
func (*KcpConfig) UpdateMode ¶
func (kconfig *KcpConfig) UpdateMode()
type LeakyBuf ¶
type LeakyBuf struct {
// contains filtered or unexported fields
}
func NewLeakyBuf ¶
NewLeakyBuf creates a leaky buffer which can hold at most n buffer, each with bufSize bytes.
type NameResolver ¶
type NameResolver interface {
Resolve(ctx context.Context, name string) (context.Context, net.IP, error)
}
NameResolver is used to implement custom name resolution
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
func (*Route) IfNoExpired ¶
func (*Route) SetExireTime ¶
type SpeedTest ¶
type SpeedTest struct { SortResults map[string][]ConfigSpeed // contains filtered or unexported fields }
func NewSpeedTest ¶
func NewSpeedTest() (tester *SpeedTest)
func (*SpeedTest) GetHistoryUrls ¶
GetHistoryUrls s GetHistoryUrls s
func (*SpeedTest) ShowConfig ¶
func (*SpeedTest) TestAllConfigs ¶
func (*SpeedTest) TestOneConfig ¶
type TlsConfig ¶
type TlsConfig struct { Ca x509.CertPool Cert tls.Certificate Server string // contains filtered or unexported fields }