Documentation ¶
Index ¶
- Constants
- Variables
- func AddTask(t *TaskList) error
- func BadRequest(w http.ResponseWriter)
- func DecodeRequest(data []byte) (*http.Request, error)
- func DecodeResponse(data []byte) (*http.Response, error)
- func DelTask(vKey string) error
- func DomainCheck(domain string) bool
- func EncodeRequest(r *http.Request) ([]byte, error)
- func EncodeResponse(r *http.Response) ([]byte, error)
- func GetEncodeResponse(req *http.Request) ([]byte, error)
- func GetRandomString(l int) string
- func Gethostbyname(hostname string) string
- func InitFromCsv()
- func InitMode()
- func Md5(s string) string
- func ProcessHost(c *Conn, s *TunnelModeServer) error
- func ProcessHttp(c *Conn, s *TunnelModeServer) error
- func ProcessTunnel(c *Conn, s *TunnelModeServer) error
- func StartTask(vKey string) error
- func StopServer(cFlag string) error
- type Config
- type Conn
- func (s *Conn) Close() error
- func (s *Conn) GetCompressTypeFromConn() (en, de int)
- func (s *Conn) GetHost() (method, address string, rb []byte, err error)
- func (s *Conn) GetHostFromConn() (typeStr string, host string, en, de int, 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) ReadFromCompress(b []byte, compress int) (int, error)
- func (s *Conn) ReadLen(len int) ([]byte, error)
- func (s *Conn) SetAlive()
- func (s *Conn) Write(b []byte) (int, error)
- func (s *Conn) WriteCompress(b []byte, compress int) (n int, err error)
- func (s *Conn) WriteCompressType(en, de int)
- func (s *Conn) WriteHost(ltype string, host string) (int, error)
- func (s *Conn) WriteLen(buf []byte) (int, error)
- type Csv
- func (s *Csv) AddRunList(vKey string, svr interface{})
- func (s *Csv) DelHost(host string) error
- func (s *Csv) DelRunList(vKey string)
- func (s *Csv) DelTask(vKey string) error
- func (s *Csv) GetHostList(start, length int, vKey string) ([]*HostList, int)
- func (s *Csv) GetTask(vKey string) (v *TaskList, err error)
- func (s *Csv) GetTaskList(start, length int, typeVal string) ([]*TaskList, int)
- func (s *Csv) Init()
- func (s *Csv) LoadHostFromCsv()
- func (s *Csv) LoadTaskFromCsv()
- func (s *Csv) NewHost(t *HostList)
- func (s *Csv) NewTask(t *TaskList)
- func (s *Csv) StoreHostToCsv()
- func (s *Csv) StoreTasksToCsv()
- func (s *Csv) UpdateTask(t *TaskList) error
- type GzipConn
- type HostList
- type HostServer
- type HttpModeServer
- type JsonStruct
- type Site
- type SnappyConn
- type Sock5ModeServer
- type TRPClient
- type TaskList
- type Tunnel
- type TunnelModeServer
- type UdpModeServer
- type WebServer
Constants ¶
View Source
const ( VERIFY_EER = "vkey" WORK_MAIN = "main" WORK_CHAN = "chan" RES_SIGN = "sign" RES_MSG = "msg0" TEST_FLAG = "tst" CONN_TCP = "tcp" CONN_UDP = "udp" )
View Source
const ( COMPRESS_NONE = iota COMPRESS_SNAPY_ENCODE COMPRESS_SNAPY_DECODE COMPRESS_GZIP_ENCODE COMPRESS_GZIP_DECODE )
View Source
const (
UserPassAuth = uint8(2)
)
Variables ¶
View Source
var ( TcpPort = flag.Int("tcpport", 8284, "客户端与服务端通信端口") RunList map[string]interface{} //运行中的任务 CsvDb *Csv )
Functions ¶
func BadRequest ¶
func BadRequest(w http.ResponseWriter)
func DomainCheck ¶
func Gethostbyname ¶
func StopServer ¶
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) GetHostFromConn ¶
读取host 连接地址 压缩类型
func (*Conn) ReadFromCompress ¶
压缩方式读
func (*Conn) WriteCompress ¶
压缩方式写
type Csv ¶
type Csv struct { Tasks []*TaskList Path string Bridge *Tunnel RunList map[string]interface{} Hosts []*HostList //域名列表 }
func (*Csv) AddRunList ¶
func (*Csv) DelRunList ¶
func (*Csv) GetHostList ¶
func (*Csv) GetTaskList ¶
func (*Csv) LoadHostFromCsv ¶
func (s *Csv) LoadHostFromCsv()
func (*Csv) LoadTaskFromCsv ¶
func (s *Csv) LoadTaskFromCsv()
func (*Csv) StoreHostToCsv ¶
func (s *Csv) StoreHostToCsv()
func (*Csv) StoreTasksToCsv ¶
func (s *Csv) StoreTasksToCsv()
func (*Csv) UpdateTask ¶
type GzipConn ¶
type GzipConn struct {
// contains filtered or unexported fields
}
func NewGzipConn ¶
type HostServer ¶
type HostServer struct { }
host
func NewHostServer ¶
func NewHostServer() *HostServer
func (*HostServer) Close ¶
func (s *HostServer) Close() error
type HttpModeServer ¶
type HttpModeServer struct {
// contains filtered or unexported fields
}
func NewHttpModeServer ¶
type SnappyConn ¶
type SnappyConn struct {
// contains filtered or unexported fields
}
func NewSnappyConn ¶
func NewSnappyConn(conn net.Conn) *SnappyConn
type Sock5ModeServer ¶
type Sock5ModeServer struct {
// contains filtered or unexported fields
}
func NewSock5ModeServer ¶
func (*Sock5ModeServer) Close ¶
func (s *Sock5ModeServer) Close() error
func (*Sock5ModeServer) Start ¶
func (s *Sock5ModeServer) Start() error
type TunnelModeServer ¶
type TunnelModeServer struct {
// contains filtered or unexported fields
}
func NewTunnelModeServer ¶
func (*TunnelModeServer) Close ¶
func (s *TunnelModeServer) Close() error
type UdpModeServer ¶
type UdpModeServer struct {
// contains filtered or unexported fields
}
func NewUdpModeServer ¶
func (*UdpModeServer) Close ¶
func (s *UdpModeServer) Close() error
Click to show internal directories.
Click to hide internal directories.