Versions in this module Expand all Collapse all v0 v0.0.13 Feb 2, 2019 Changes in this version + var Log *log.Logger + func Fatalf(format string, v ...interface{}) + func Fatalln(v ...interface{}) + func FileExists(name string) bool + func InitDaemon(f string) + func InitLogFile(f string, isStdout bool) + func Printf(format string, v ...interface{}) + func Println(v ...interface{}) type Host + NowIndex int + TargetArr []string + func (s *Host) GetRandomTarget() string v0.0.12 Jan 31, 2019 Changes in this version + const NEW_CONN + var BufPool = sync.Pool + var BufPoolCopy = sync.Pool + var BufPoolMax = sync.Pool + var BufPoolSmall = sync.Pool + func PutBufPoolCopy(buf []byte) type Client + func (s *Client) GetId() int type Conn + func (s *Conn) GetConnStatus() (id int, status bool, err error) + func (s *Conn) GetLinkInfo() (link *Link, err error) + func (s *Conn) GetMsgContent(link *Link) (content []byte, err error) + func (s *Conn) SendLinkInfo(link *Link) (int, error) + func (s *Conn) SendMsg(content []byte, link *Link) (n int, err error) type Flow + func (s *Flow) Add(in, out int) + type Link struct + Conn *Conn + ConnType string + Crypt bool + De int + En int + Flow *Flow + Host string + Id int + Rate *Rate + UdpListener *net.UDPConn + UdpRemoteAddr *net.UDPAddr + func NewLink(id int, connType string, host string, en, de int, crypt bool, conn *Conn, ...) *Link v0.0.11 Jan 28, 2019 Changes in this version + const RES_CLOSE type Client + Rate *Rate + RateLimit int type Conn + func (s *Conn) SetReadDeadline(t time.Duration) + func (s *Conn) WriteClose() (int, error) type Flow + FlowLimit int64 + type Rate struct + func NewRate(addSize int64) *Rate + func (s *Rate) Get(size int64) + func (s *Rate) ReturnBucket(size int64) + func (s *Rate) Start() + func (s *Rate) Stop() v0.0.10 Jan 26, 2019 Changes in this version + const ConnectionFailBytes + const UnauthorizedBytes + var BufPoolUdp = sync.Pool + func GetHostByName(hostname string) string + func GetIntNoErrByStr(str string) int + func ReadAllFromFile(filePth string) ([]byte, error) + type Client struct + Addr string + Cnf *Config + Flow *Flow + Id int + IsConnect bool + Remark string + Status bool + VerifyKey string + type Config struct + Compress string + CompressDecode int + CompressEncode int + Crypt bool + Mux bool + P string + U string + func DeepCopyConfig(c *Config) *Config + type Csv struct + ClientIncreaseId int + Clients []*Client + Hosts []*Host + Path string + TaskIncreaseId int + Tasks []*Tunnel + var CsvDb *Csv + func GetCsvDb() *Csv + func NewCsv() *Csv + func (s *Csv) DelClient(id int) error + func (s *Csv) DelHost(host string) error + func (s *Csv) DelTask(id int) error + func (s *Csv) GetClient(id int) (v *Client, err error) + func (s *Csv) GetClientId() int + func (s *Csv) GetClientList(start, length int) ([]*Client, int) + func (s *Csv) GetHost(start, length int, id int) ([]*Host, int) + func (s *Csv) GetIdByVerifyKey(vKey string, addr string) (int, error) + func (s *Csv) GetTask(id int) (v *Tunnel, err error) + func (s *Csv) GetTaskId() int + func (s *Csv) Init() + func (s *Csv) LoadClientFromCsv() + func (s *Csv) LoadHostFromCsv() + func (s *Csv) LoadTaskFromCsv() + func (s *Csv) NewClient(c *Client) + func (s *Csv) NewHost(t *Host) + func (s *Csv) NewTask(t *Tunnel) + func (s *Csv) StoreClientsToCsv() + func (s *Csv) StoreHostToCsv() + func (s *Csv) StoreTasksToCsv() + func (s *Csv) UpdateClient(t *Client) error + func (s *Csv) UpdateHost(t *Host) error + func (s *Csv) UpdateTask(t *Tunnel) error + type Flow struct + ExportFlow int64 + InletFlow int64 + type Host struct + Client *Client + Flow *Flow + HeaderChange string + Host string + HostChange string + Remark string + Target string + type Tunnel struct + Client *Client + Config *Config + Flow *Flow + Id int + Mode string + Remark string + Status bool + Target string + TcpPort int + UseClientCnf bool v0.0.9 Jan 12, 2019 Changes in this version + func ChangeHostAndHeader(r *http.Request, host string, header string, addr string) + func ReplayWaitGroup(conn1 net.Conn, conn2 net.Conn, compressEncode, compressDecode int, ...) v0.0.8 Jan 9, 2019 Changes in this version + const COMPRESS_NONE_DECODE + const COMPRESS_NONE_ENCODE + const COMPRESS_SNAPY_DECODE + const COMPRESS_SNAPY_ENCODE + const CONN_ERROR + const CONN_SUCCESS + const CONN_TCP + const CONN_UDP + const IO_EOF + const RES_MSG + const RES_SIGN + const TEST_FLAG + const Unauthorized_BYTES + const VERIFY_EER + const WORK_CHAN + const WORK_MAIN + func AesDecrypt(crypted, key []byte) ([]byte, error) + func AesEncrypt(origData, key []byte) ([]byte, error) + func CheckAuth(r *http.Request, user, passwd string) bool + func DomainCheck(domain string) bool + func FlushConn(c net.Conn) + func GetBoolByStr(s string) bool + func GetCompressType(compress string) (int, int) + func GetIntNoerrByStr(str string) int + func GetLenByBytes(buf []byte) (int, error) + func GetLenBytes(buf []byte) (b []byte, err error) + func GetRandomString(l int) string + func GetStrByBool(b bool) string + func Gethostbyname(hostname string) string + func Getverifyval(vkey string) string + func Md5(s string) string + func PKCS5Padding(ciphertext []byte, blockSize int) []byte + func PKCS5UnPadding(origData []byte) (error, []byte) + func Relay(in, out net.Conn, compressType int, crypt, mux bool) + type Conn struct + Conn net.Conn + func NewConn(conn net.Conn) *Conn + func (s *Conn) Close() error + func (s *Conn) GetConnInfoFromConn() (en, de int, crypt, mux bool) + func (s *Conn) GetHost() (method, address string, rb []byte, err error, r *http.Request) + func (s *Conn) GetHostFromConn() (typeStr string, host string, en, de int, crypt, mux bool, err error) + func (s *Conn) GetLen() (int, error) + func (s *Conn) Read(b []byte) (int, error) + func (s *Conn) ReadFlag() (string, error) + func (s *Conn) ReadFrom(b []byte, compress int, crypt bool) (int, error) + func (s *Conn) ReadLen(cLen int) ([]byte, error) + func (s *Conn) SetAlive() + func (s *Conn) Write(b []byte) (int, error) + func (s *Conn) WriteChan() (int, error) + func (s *Conn) WriteConnInfo(en, de int, crypt, mux bool) + func (s *Conn) WriteError() (int, error) + func (s *Conn) WriteFail() (int, error) + func (s *Conn) WriteHost(ltype string, host string) (int, error) + func (s *Conn) WriteLen(buf []byte) (int, error) + func (s *Conn) WriteMain() (int, error) + func (s *Conn) WriteSign() (int, error) + func (s *Conn) WriteSuccess() (int, error) + func (s *Conn) WriteTest() (int, error) + func (s *Conn) WriteTo(b []byte, compress int, crypt bool) (n int, err error) + type CryptConn struct + func NewCryptConn(conn net.Conn, crypt bool) *CryptConn + func (s *CryptConn) Read(b []byte) (n int, err error) + func (s *CryptConn) Write(b []byte) (n int, err error) + type SnappyConn struct + func NewSnappyConn(conn net.Conn, crypt bool) *SnappyConn + func (s *SnappyConn) Read(b []byte) (n int, err error) + func (s *SnappyConn) Write(b []byte) (n int, err error)