Documentation
¶
Index ¶
- Constants
- Variables
- func AesDecrypt(crypted, key []byte) ([]byte, error)
- func AesEncrypt(origData, key []byte) ([]byte, error)
- func ChangeHostAndHeader(r *http.Request, host string, header string, addr string)
- func CheckAuth(r *http.Request, user, passwd string) bool
- func DomainCheck(domain string) bool
- func GetBoolByStr(s string) bool
- func GetCompressType(compress string) (int, int)
- func GetHostByName(hostname string) string
- 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 Getverifyval(vkey string) string
- func Md5(s string) string
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) (error, []byte)
- func PutBufPoolCopy(buf []byte)
- func ReadAllFromFile(filePath string) ([]byte, error)
- type Client
- type Config
- type Conn
- func (s *Conn) Close() error
- func (s *Conn) GetConnStatus() (id int, status bool, err error)
- func (s *Conn) GetHost() (method, address string, rb []byte, err error, r *http.Request)
- func (s *Conn) GetLen() (int, error)
- func (s *Conn) GetLinkInfo() (link *Link, err error)
- func (s *Conn) GetMsgContent(link *Link) (content []byte, err 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, rate *Rate) (int, error)
- func (s *Conn) ReadLen(cLen int) ([]byte, error)
- func (s *Conn) SendLinkInfo(link *Link) (int, error)
- func (s *Conn) SendMsg(content []byte, link *Link) (n int, err error)
- func (s *Conn) SetAlive()
- func (s *Conn) SetReadDeadline(t time.Duration)
- func (s *Conn) Write(b []byte) (int, error)
- func (s *Conn) WriteChan() (int, error)
- func (s *Conn) WriteClose() (int, error)
- func (s *Conn) WriteError() (int, error)
- func (s *Conn) WriteFail(id int) (int, error)
- func (s *Conn) WriteMain() (int, error)
- func (s *Conn) WriteSign() (int, error)
- func (s *Conn) WriteSuccess(id int) (int, error)
- func (s *Conn) WriteTo(b []byte, compress int, crypt bool, rate *Rate) (n int, err error)
- type CryptConn
- type 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
- type Host
- type Link
- type Rate
- type SnappyConn
- type Tunnel
Constants ¶
View Source
const ( COMPRESS_NONE_ENCODE = iota COMPRESS_NONE_DECODE COMPRESS_SNAPY_ENCODE COMPRESS_SNAPY_DECODE VERIFY_EER = "vkey" WORK_MAIN = "main" WORK_CHAN = "chan" RES_SIGN = "sign" RES_MSG = "msg0" RES_CLOSE = "clse" NEW_CONN = "conn" //新连接标志 CONN_SUCCESS = "sucs" CONN_TCP = "tcp" CONN_UDP = "udp" Content-Type: text/plain; charset=utf-8 WWW-Authenticate: Basic realm="easyProxy" 401 Unauthorized` IO_EOF = "PROXYEOF" ConnectionFailBytes = `HTTP/1.1 404 Not Found ` )
Variables ¶
View Source
var BufPool = sync.Pool{ New: func() interface{} { return make([]byte, poolSize) }, }
View Source
var BufPoolCopy = sync.Pool{ New: func() interface{} { return make([]byte, poolSizeCopy) }, }
View Source
var BufPoolMax = sync.Pool{ New: func() interface{} { return make([]byte, poolSize) }, }
View Source
var BufPoolSmall = sync.Pool{ New: func() interface{} { return make([]byte, poolSizeSmall) }, }
View Source
var BufPoolUdp = sync.Pool{ New: func() interface{} { return make([]byte, poolSizeUdp) }, }
Functions ¶
func ChangeHostAndHeader ¶ added in v0.0.9
func PutBufPoolCopy ¶ added in v0.0.12
func PutBufPoolCopy(buf []byte)
func ReadAllFromFile ¶ added in v0.0.10
Types ¶
type Client ¶ added in v0.0.10
type Config ¶ added in v0.0.10
type Conn ¶
func (*Conn) GetConnStatus ¶ added in v0.0.12
read connect status
func (*Conn) GetLinkInfo ¶ added in v0.0.12
func (*Conn) GetMsgContent ¶ added in v0.0.12
get msg content from conn
func (*Conn) SendLinkInfo ¶ added in v0.0.12
send info for link
func (*Conn) SetReadDeadline ¶ added in v0.0.11
set read dead time
type Csv ¶ added in v0.0.10
type Csv struct { Tasks []*Tunnel Path string Hosts []*Host //域名列表 Clients []*Client //客户端 ClientIncreaseId int //客户端id TaskIncreaseId int //任务自增ID sync.Mutex }
var (
CsvDb *Csv
)
func (*Csv) GetClientId ¶ added in v0.0.10
func (*Csv) GetClientList ¶ added in v0.0.10
func (*Csv) GetIdByVerifyKey ¶ added in v0.0.10
func (*Csv) LoadClientFromCsv ¶ added in v0.0.10
func (s *Csv) LoadClientFromCsv()
func (*Csv) LoadHostFromCsv ¶ added in v0.0.10
func (s *Csv) LoadHostFromCsv()
func (*Csv) LoadTaskFromCsv ¶ added in v0.0.10
func (s *Csv) LoadTaskFromCsv()
func (*Csv) StoreClientsToCsv ¶ added in v0.0.10
func (s *Csv) StoreClientsToCsv()
func (*Csv) StoreHostToCsv ¶ added in v0.0.10
func (s *Csv) StoreHostToCsv()
func (*Csv) StoreTasksToCsv ¶ added in v0.0.10
func (s *Csv) StoreTasksToCsv()
func (*Csv) UpdateClient ¶ added in v0.0.10
func (*Csv) UpdateHost ¶ added in v0.0.10
func (*Csv) UpdateTask ¶ added in v0.0.10
type Flow ¶ added in v0.0.10
type Link ¶ added in v0.0.12
type SnappyConn ¶
type SnappyConn struct {
// contains filtered or unexported fields
}
func NewSnappyConn ¶
func NewSnappyConn(conn net.Conn, crypt bool, rate *Rate) *SnappyConn
Click to show internal directories.
Click to hide internal directories.