Documentation
¶
Index ¶
- Constants
- Variables
- func DebugLog(format string, args ...interface{})
- func ErrorLog(format string, args ...interface{})
- func InfoLog(format string, args ...interface{})
- func ReadJSON(filename string, v interface{}) (err error)
- func SHA1(data []byte) string
- func SetLogLevel(l int)
- func WarnLog(format string, args ...interface{})
- type Config
- type ConfigHost
- type Debuger
- func (d *Debuger) Accept() (conn net.Conn, err error)
- func (d *Debuger) Addr() net.Addr
- func (d *Debuger) Close() (err error)
- func (d *Debuger) Network() string
- func (d *Debuger) ProcConn(uri string, raw net.Conn) (async bool, err error)
- func (d *Debuger) Serve() (err error)
- func (d *Debuger) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (d *Debuger) String() string
- type Decorder
- type DecorderCreator
- type PipedConn
- func (p *PipedConn) Close() (err error)
- func (p *PipedConn) LocalAddr() net.Addr
- func (p *PipedConn) Network() string
- func (p *PipedConn) RemoteAddr() net.Addr
- func (p *PipedConn) SetDeadline(t time.Time) error
- func (p *PipedConn) SetReadDeadline(t time.Time) error
- func (p *PipedConn) SetWriteDeadline(t time.Time) error
- func (p *PipedConn) String() string
- type SocksProxy
- type StringConn
- type TCPKeepAliveListener
- type TLSCertCenter
- type TLSDecorder
Constants ¶
const ( //LogLevelDebug is debug log level LogLevelDebug = 40 //LogLevelInfo is info log level LogLevelInfo = 30 //LogLevelWarn is warn log level LogLevelWarn = 20 //LogLevelError is error log level LogLevelError = 10 )
Variables ¶
var BasePipe = os.Pipe
BasePipe is func to create os pipe
Functions ¶
Types ¶
type Config ¶
type Config struct { Hosts []*ConfigHost `json:"hosts"` Decorder []map[string]interface{} `json:"decorder"` }
Config is pojo to debuger configure
type ConfigHost ¶
type ConfigHost struct { Host string `json:"host"` IP string `json:"ip"` Decorder string `json:"decorder"` Forward string `json:"forward"` DumpRequest int `json:"dump_request"` }
ConfigHost is pojo to debuger configure
type Debuger ¶
type Debuger struct { *Config Decorder DecorderCreator // contains filtered or unexported fields }
Debuger provider the web debuger suppported
func NewDebuger ¶
NewDebuger will return new Debuger
type DecorderCreator ¶
type DecorderCreator func(name string, config map[string]interface{}) (decorder Decorder, err error)
DecorderCreator is a func define to create Decorder by configure
type PipedConn ¶
PipedConn is connection piped read and write
func CreatePipeConn ¶
CreatePipeConn will create pipe connection
func (*PipedConn) RemoteAddr ¶
RemoteAddr is net.Conn impl
func (*PipedConn) SetDeadline ¶
SetDeadline is net.Conn impl
func (*PipedConn) SetReadDeadline ¶
SetReadDeadline is net.Conn impl
func (*PipedConn) SetWriteDeadline ¶
SetWriteDeadline is net.Conn impl
type SocksProxy ¶
type SocksProxy struct { net.Listener HTTPUpstream string ProcConn func(uri string, raw net.Conn) (async bool, err error) }
SocksProxy is an implementation of socks5 proxy
func NewSocksProxy ¶
func NewSocksProxy() (socks *SocksProxy)
NewSocksProxy will return new SocksProxy
type StringConn ¶
StringConn is an ReadWriteCloser for return remote address info
func NewStringConn ¶
func NewStringConn(raw net.Conn) *StringConn
NewStringConn will return new StringConn
func (*StringConn) String ¶
func (s *StringConn) String() string
type TCPKeepAliveListener ¶
type TCPKeepAliveListener struct {
*net.TCPListener
}
TCPKeepAliveListener is normal tcp listner for set tcp connection keep alive
type TLSCertCenter ¶
type TLSCertCenter struct {
// contains filtered or unexported fields
}
TLSCertCenter provider cert server and it will service the TLSDecorder
func NewTLSCertCenter ¶
func NewTLSCertCenter(certs ...map[string]interface{}) (center *TLSCertCenter)
NewTLSCertCenter will return new TLSCertCenter by cert configure
func (*TLSCertCenter) ServeHTTP ¶
func (t *TLSCertCenter) ServeHTTP(w http.ResponseWriter, r *http.Request)
type TLSDecorder ¶
type TLSDecorder struct { Name string Server string Username string Password string Cert, Key string // contains filtered or unexported fields }
TLSDecorder provider Decorder to decord conenction by tls cert
func NewTLSDecorder ¶
func NewTLSDecorder() (decorder *TLSDecorder)
NewTLSDecorder will create new TLSDecorder