Documentation ¶
Index ¶
- type BaseHandler
- type HandlerKey
- type HandlerMgr
- type HttpHandler
- func (pr *HttpHandler) AddMgr(mgr *HandlerMgr)
- func (pr *HttpHandler) Close()
- func (pr *HttpHandler) Communicate()
- func (pr *HttpHandler) ReadLocal(buf []byte) error
- func (pr *HttpHandler) ReadRemote(buf []byte) error
- func (pr *HttpHandler) Remove()
- func (handler *HttpHandler) Tunnel() error
- func (pr *HttpHandler) WriteLocal(buf []byte) error
- func (pr *HttpHandler) WriteRemote(buf []byte) error
- type HttpHandlerEProxy
- func (pr *HttpHandlerEProxy) AddMgr(mgr *HandlerMgr)
- func (pr *HttpHandlerEProxy) Close()
- func (pr *HttpHandlerEProxy) Communicate()
- func (pr *HttpHandlerEProxy) ReadLocal(buf []byte) error
- func (pr *HttpHandlerEProxy) ReadRemote(buf []byte) error
- func (pr *HttpHandlerEProxy) Remove()
- func (handler *HttpHandlerEProxy) Tunnel() error
- func (pr *HttpHandlerEProxy) WriteLocal(buf []byte) error
- func (pr *HttpHandlerEProxy) WriteRemote(buf []byte) error
- type ProtoTyp
- type Sock4Handler
- func (pr *Sock4Handler) AddMgr(mgr *HandlerMgr)
- func (pr *Sock4Handler) Close()
- func (pr *Sock4Handler) Communicate()
- func (pr *Sock4Handler) ReadLocal(buf []byte) error
- func (pr *Sock4Handler) ReadRemote(buf []byte) error
- func (pr *Sock4Handler) Remove()
- func (handler *Sock4Handler) Tunnel() error
- func (pr *Sock4Handler) WriteLocal(buf []byte) error
- func (pr *Sock4Handler) WriteRemote(buf []byte) error
- type TcpSock5Handler
- func (pr *TcpSock5Handler) AddMgr(mgr *HandlerMgr)
- func (pr *TcpSock5Handler) Close()
- func (pr *TcpSock5Handler) Communicate()
- func (pr *TcpSock5Handler) ReadLocal(buf []byte) error
- func (pr *TcpSock5Handler) ReadRemote(buf []byte) error
- func (pr *TcpSock5Handler) Remove()
- func (handler *TcpSock5Handler) Tunnel() error
- func (pr *TcpSock5Handler) WriteLocal(buf []byte) error
- func (pr *TcpSock5Handler) WriteRemote(buf []byte) error
- type UdpSock5Handler
- func (pr *UdpSock5Handler) AddMgr(mgr *HandlerMgr)
- func (handler *UdpSock5Handler) Close()
- func (handler *UdpSock5Handler) Communicate()
- func (handler *UdpSock5Handler) Read(buf []byte) (int, error)
- func (pr *UdpSock5Handler) ReadLocal(buf []byte) error
- func (pr *UdpSock5Handler) ReadRemote(buf []byte) error
- func (pr *UdpSock5Handler) Remove()
- func (handler *UdpSock5Handler) Tunnel() error
- func (handler *UdpSock5Handler) Write(buf []byte) (int, error)
- func (pr *UdpSock5Handler) WriteLocal(buf []byte) error
- func (pr *UdpSock5Handler) WriteRemote(buf []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseHandler ¶
type BaseHandler interface { // connection Tunnel() error // close Close() // direct close handler Remove() // remove self from map AddMgr(mgr *HandlerMgr) // write and read WriteRemote([]byte) error WriteLocal([]byte) error ReadRemote([]byte) error ReadLocal([]byte) error Communicate() }
func NewHandler ¶
type HandlerKey ¶
handler key in case keep the same handler
type HandlerMgr ¶
type HandlerMgr struct {
// contains filtered or unexported fields
}
manager all handler
func NewHandlerMgr ¶
func NewHandlerMgr(scope define.Scope) *HandlerMgr
func (*HandlerMgr) AddHandler ¶
func (mgr *HandlerMgr) AddHandler(typ ProtoTyp, key HandlerKey, base BaseHandler)
add handler to mgr
func (*HandlerMgr) CloseBaseHandler ¶
func (mgr *HandlerMgr) CloseBaseHandler(typ ProtoTyp, key HandlerKey)
close and remove base handler
func (*HandlerMgr) CloseTypHandler ¶
func (mgr *HandlerMgr) CloseTypHandler(typ ProtoTyp)
close handler according to proto
type HttpHandler ¶
type HttpHandler struct {
// contains filtered or unexported fields
}
tcp handler create handle bind lConn conn and rConn conn
func NewHttpHandler ¶
func (*HttpHandler) AddMgr ¶
func (pr *HttpHandler) AddMgr(mgr *HandlerMgr)
add private to manager and save manager
func (*HttpHandler) ReadRemote ¶
func (*HttpHandler) Tunnel ¶
func (handler *HttpHandler) Tunnel() error
create tunnel between proxy and server
func (*HttpHandler) WriteLocal ¶
func (*HttpHandler) WriteRemote ¶
type HttpHandlerEProxy ¶
type HttpHandlerEProxy struct {
// contains filtered or unexported fields
}
func NewHttpHandlerEProxy ¶
func (*HttpHandlerEProxy) AddMgr ¶
func (pr *HttpHandlerEProxy) AddMgr(mgr *HandlerMgr)
add private to manager and save manager
func (*HttpHandlerEProxy) Communicate ¶
func (pr *HttpHandlerEProxy) Communicate()
communicate lConn and rConn
func (*HttpHandlerEProxy) ReadRemote ¶
func (*HttpHandlerEProxy) Remove ¶
func (pr *HttpHandlerEProxy) Remove()
close and delete handler from manager
func (*HttpHandlerEProxy) Tunnel ¶
func (handler *HttpHandlerEProxy) Tunnel() error
func (*HttpHandlerEProxy) WriteLocal ¶
func (*HttpHandlerEProxy) WriteRemote ¶
type Sock4Handler ¶
type Sock4Handler struct {
// contains filtered or unexported fields
}
func NewSock4Handler ¶
func (*Sock4Handler) AddMgr ¶
func (pr *Sock4Handler) AddMgr(mgr *HandlerMgr)
add private to manager and save manager
func (*Sock4Handler) Communicate ¶
func (pr *Sock4Handler) Communicate()
communicate lConn and rConn
func (*Sock4Handler) ReadRemote ¶
func (*Sock4Handler) Remove ¶
func (pr *Sock4Handler) Remove()
close and delete handler from manager
func (*Sock4Handler) Tunnel ¶
func (handler *Sock4Handler) Tunnel() error
func (*Sock4Handler) WriteLocal ¶
func (*Sock4Handler) WriteRemote ¶
type TcpSock5Handler ¶
type TcpSock5Handler struct {
// contains filtered or unexported fields
}
func NewTcpSock5Handler ¶
func (*TcpSock5Handler) AddMgr ¶
func (pr *TcpSock5Handler) AddMgr(mgr *HandlerMgr)
add private to manager and save manager
func (*TcpSock5Handler) Communicate ¶
func (pr *TcpSock5Handler) Communicate()
communicate lConn and rConn
func (*TcpSock5Handler) ReadRemote ¶
func (*TcpSock5Handler) Remove ¶
func (pr *TcpSock5Handler) Remove()
close and delete handler from manager
func (*TcpSock5Handler) Tunnel ¶
func (handler *TcpSock5Handler) Tunnel() error
create tunnel between proxy and server
func (*TcpSock5Handler) WriteLocal ¶
func (*TcpSock5Handler) WriteRemote ¶
type UdpSock5Handler ¶
type UdpSock5Handler struct {
// contains filtered or unexported fields
}
func NewUdpSock5Handler ¶
func (*UdpSock5Handler) AddMgr ¶
func (pr *UdpSock5Handler) AddMgr(mgr *HandlerMgr)
add private to manager and save manager
func (*UdpSock5Handler) Communicate ¶
func (handler *UdpSock5Handler) Communicate()
rewrite communication
func (*UdpSock5Handler) Read ¶
func (handler *UdpSock5Handler) Read(buf []byte) (int, error)
rewrite read remote
func (*UdpSock5Handler) ReadRemote ¶
func (*UdpSock5Handler) Remove ¶
func (pr *UdpSock5Handler) Remove()
close and delete handler from manager
func (*UdpSock5Handler) Tunnel ¶
func (handler *UdpSock5Handler) Tunnel() error
create tunnel between proxy and server
func (*UdpSock5Handler) Write ¶
func (handler *UdpSock5Handler) Write(buf []byte) (int, error)
rewrite write remote