Documentation ¶
Index ¶
- Constants
- Variables
- func AddTask(t *ServerConfig) error
- func AesDecrypt(crypted, key []byte) ([]byte, error)
- func AesEncrypt(origData, key []byte) ([]byte, 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 GetBoolByStr(s string) bool
- func GetEncodeResponse(req *http.Request) ([]byte, error)
- 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 InitFromCsv()
- func InitMode()
- func Md5(s string) string
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) []byte
- 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) 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(len int) ([]byte, error)
- func (s *Conn) SetAlive()
- func (s *Conn) Write(b []byte) (int, error)
- func (s *Conn) WriteConnInfo(en, de int, crypt, mux bool)
- func (s *Conn) WriteHost(ltype string, host string) (int, error)
- func (s *Conn) WriteLen(buf []byte) (int, error)
- func (s *Conn) WriteTo(b []byte, compress int, crypt bool) (n int, err error)
- type CryptConn
- 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) GetServerConfig(start, length int, typeVal string) ([]*ServerConfig, int)
- func (s *Csv) GetTask(vKey string) (v *ServerConfig, err error)
- func (s *Csv) Init()
- func (s *Csv) LoadHostFromCsv()
- func (s *Csv) LoadTaskFromCsv()
- func (s *Csv) NewHost(t *HostList)
- func (s *Csv) NewTask(t *ServerConfig)
- func (s *Csv) StoreHostToCsv()
- func (s *Csv) StoreTasksToCsv()
- func (s *Csv) UpdateTask(t *ServerConfig) error
- type HostList
- type HostServer
- type HttpModeServer
- type JsonStruct
- type ServerConfig
- type Site
- type SnappyConn
- type Sock5ModeServer
- type TRPClient
- type Tunnel
- func (s *Tunnel) DelClientSignal(cFlag string)
- func (s *Tunnel) DelClientTunnel(cFlag string)
- func (s *Tunnel) GetSignal(cFlag string) (err error, conn *Conn)
- func (s *Tunnel) GetTunnel(cFlag string, en, de int, crypt, mux bool) (c *Conn, err error)
- func (s *Tunnel) ReturnSignal(conn *Conn, cFlag string)
- func (s *Tunnel) ReturnTunnel(conn *Conn, cFlag string)
- func (s *Tunnel) StartTunnel() error
- 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" Content-Type: text/plain; charset=utf-8 WWW-Authenticate: Basic realm="easyProxy" 401 Unauthorized` )
View Source
const ( COMPRESS_NONE_ENCODE = iota COMPRESS_NONE_DECODE COMPRESS_SNAPY_ENCODE COMPRESS_SNAPY_DECODE IO_EOF = "EOF" )
View Source
const (
UserPassAuth = uint8(2)
)
Variables ¶
View Source
var ( TcpPort = flag.Int("tcpport", 8284, "客户端与服务端通信端口") RunList map[string]interface{} //运行中的任务 CsvDb *Csv )
View Source
var GlobalHostSessions *session.Manager
Functions ¶
func AddTask ¶
func AddTask(t *ServerConfig) error
func GetIntNoerrByStr ¶
func StopServer ¶
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
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 ¶
type Csv struct { Tasks []*ServerConfig Path string Bridge *Tunnel RunList map[string]interface{} Hosts []*HostList //域名列表 }
func (*Csv) AddRunList ¶
func (*Csv) DelRunList ¶
func (*Csv) GetHostList ¶
func (*Csv) GetServerConfig ¶
func (s *Csv) GetServerConfig(start, length int, typeVal string) ([]*ServerConfig, int)
func (*Csv) LoadHostFromCsv ¶
func (s *Csv) LoadHostFromCsv()
func (*Csv) LoadTaskFromCsv ¶
func (s *Csv) LoadTaskFromCsv()
func (*Csv) NewTask ¶
func (s *Csv) NewTask(t *ServerConfig)
func (*Csv) StoreHostToCsv ¶
func (s *Csv) StoreHostToCsv()
func (*Csv) StoreTasksToCsv ¶
func (s *Csv) StoreTasksToCsv()
func (*Csv) UpdateTask ¶
func (s *Csv) UpdateTask(t *ServerConfig) error
type HttpModeServer ¶
type HttpModeServer struct {
// contains filtered or unexported fields
}
func NewHttpModeServer ¶
func NewHttpModeServer(bridge *Tunnel, cnf *ServerConfig) *HttpModeServer
http
type ServerConfig ¶
type ServerConfig struct { TcpPort int //服务端与客户端通信端口 Mode string //启动方式 Target string //目标 VerifyKey string //flag U string //socks5验证用户名 P string //socks5验证密码 Compress string //压缩方式 Start int //是否开启 IsRun int //是否在运行 ClientStatus int //客s户端状态 Crypt bool //是否加密 Mux bool //是否加密 CompressEncode int CompressDecode int }
type SnappyConn ¶
type SnappyConn struct {
// contains filtered or unexported fields
}
func NewSnappyConn ¶
func NewSnappyConn(conn net.Conn, crypt bool) *SnappyConn
type Sock5ModeServer ¶
type Sock5ModeServer struct {
// contains filtered or unexported fields
}
func NewSock5ModeServer ¶
func NewSock5ModeServer(bridge *Tunnel, cnf *ServerConfig) *Sock5ModeServer
new
type Tunnel ¶
func (*Tunnel) StartTunnel ¶
type TunnelModeServer ¶
type TunnelModeServer struct {
// contains filtered or unexported fields
}
func NewTunnelModeServer ¶
func NewTunnelModeServer(process process, bridge *Tunnel, cnf *ServerConfig) *TunnelModeServer
tcp|http|host
type UdpModeServer ¶
type UdpModeServer struct {
// contains filtered or unexported fields
}
func NewUdpModeServer ¶
func NewUdpModeServer(bridge *Tunnel, cnf *ServerConfig) *UdpModeServer
func (*UdpModeServer) Close ¶
func (s *UdpModeServer) Close() error
Click to show internal directories.
Click to hide internal directories.