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 FlushConn(c net.Conn)
- 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 ReadAllFromFile(filePth string) ([]byte, error)
- func Relay(in, out net.Conn, compressType int, crypt, mux bool) (n int64, err error)
- func ReplayWaitGroup(conn1 net.Conn, conn2 net.Conn, compressEncode, compressDecode int, ...) (out int64, in int64)
- type Client
- type Config
- type 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
- 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 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" CONN_SUCCESS = "sucs" CONN_ERROR = "fail" TEST_FLAG = "tst" 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 BufPoolUdp = sync.Pool{ New: func() interface{} { return make([]byte, poolSizeUdp) }, }
Functions ¶
func ChangeHostAndHeader ¶ added in v0.0.9
func ReadAllFromFile ¶ added in v0.0.10
Types ¶
type Config ¶ added in v0.0.10
type Conn ¶
func (*Conn) GetConnInfoFromConn ¶
获取压缩方式,是否加密
func (*Conn) GetHostFromConn ¶
func (s *Conn) GetHostFromConn() (typeStr string, host string, en, de int, crypt, mux bool, err error)
读取host 连接地址 压缩类型
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 SnappyConn ¶
type SnappyConn struct {
// contains filtered or unexported fields
}
func NewSnappyConn ¶
func NewSnappyConn(conn net.Conn, crypt bool) *SnappyConn
Click to show internal directories.
Click to hide internal directories.