Documentation ¶
Index ¶
- func CheckBasicConfig(c *Config)
- func CheckConfig(c *Config)
- func CheckConn(conn net.Conn) bool
- func CheckLogFile(c *Config)
- func DupBuffer(b []byte) (b2 []byte)
- func GetHeader(host string, port int) (buf []byte, err error)
- func GetInnerConn(conn net.Conn) (c net.Conn, err error)
- func GetNetTCPConn(conn net.Conn) (c *net.TCPConn, err error)
- func GetRandomBytes(len int) []byte
- func ListenMultiSS(service string, c *Config) (lis net.Listener, err error)
- func ListenRedir(address string, c *Config) (lis net.Listener, err error)
- func ListenSS(service string, c *Config) (lis net.Listener, err error)
- func ListenSocks5(address string, c *Config) (lis net.Listener, err error)
- func ListenTCPTun(address string, c *Config) (lis net.Listener, err error)
- func NewListener(lis *net.TCPListener, c *Config, handlers []listenHandler) *listener
- func NewSSDialer(c *Config) func(string) (net.Conn, error)
- func NewTCPDialer() func(string) (net.Conn, error)
- func ParseAddrWithMultipleBackends(b []byte, configs []*Config) (*parseContext, error)
- func Pipe(c1, c2 net.Conn, c *Config)
- func PutHeader(b []byte, host string, port int) (n int)
- func PutRandomBytes(b []byte)
- func SliceCopy(b []byte) []byte
- func StoreServiceHandler(addr string, handler listenHandler)
- type Acceptor
- type Addr
- type Config
- type Conn
- func DecayRemainConn(conn Conn) Conn
- func DialObfs(target string, c *Config) (conn Conn, err error)
- func DialSSWithOptions(opt *DialOptions) (conn Conn, err error)
- func DialTCPConn(address string, cfg *cfg) (Conn, error)
- func DialUDP(c *Config) (conn Conn, err error)
- func DialWsConn(address, host string, cfg *cfg) (Conn, error)
- func GetConn(conn net.Conn) (c Conn)
- type ConnPool
- type DebugConn
- type DialOptions
- type DstAddr
- type HttpLogConn
- type LimitConn
- type Limiter
- type MultiUDPConn
- type ObfsConn
- type RemainConn
- type SimpleHTTPConn
- type SimpleTLSConn
- type SockAddr
- type SsConn
- type TCPConn
- type UDPConn
- func (c *UDPConn) Close() error
- func (c *UDPConn) GetCfg() *Config
- func (ctx *UDPConn) GetDst() Addr
- func (ctx *UDPConn) GetHost() string
- func (c *UDPConn) LocalAddr() net.Addr
- func (c *UDPConn) Read(b []byte) (n int, err error)
- func (c *UDPConn) ReadFrom(b []byte) (n int, addr net.Addr, err error)
- func (c *UDPConn) RemoteAddr() net.Addr
- func (c *UDPConn) SetDeadline(t time.Time) error
- func (ctx *UDPConn) SetDst(dst Addr)
- func (ctx *UDPConn) SetHost(host string)
- func (c *UDPConn) SetReadDeadline(t time.Time) error
- func (c *UDPConn) SetWriteDeadline(t time.Time) error
- func (c *UDPConn) Write(b []byte) (n int, err error)
- func (c *UDPConn) WriteBuffers(bufs [][]byte) (n int, err error)
- func (c *UDPConn) WriteTo(b []byte, addr net.Addr) (n int, err error)
- type UDPTProxyConn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckBasicConfig ¶
func CheckBasicConfig(c *Config)
func CheckConfig ¶
func CheckConfig(c *Config)
func CheckLogFile ¶
func CheckLogFile(c *Config)
func GetRandomBytes ¶
func NewListener ¶
func NewListener(lis *net.TCPListener, c *Config, handlers []listenHandler) *listener
func PutRandomBytes ¶
func PutRandomBytes(b []byte)
func StoreServiceHandler ¶
func StoreServiceHandler(addr string, handler listenHandler)
StoreServiceHandler stores the handler to services map with key addr
Types ¶
type Acceptor ¶
func GetShadowAcceptor ¶
type Config ¶
type Config struct { Nickname string `json:"nickname"` Type string `json:"type"` Localaddr string `json:"localaddr"` Localaddrs []string `json:"localaddrs"` Remoteaddr string `json:"remoteaddr"` Method string `json:"method"` Password string `json:"password"` Nonop bool `json:"nonop"` AllowHTTP bool `json:"allow_http"` UDPRelay bool `json:"udprelay"` Backend *Config `json:"backend"` Backends []*Config `json:"backends"` Verbose bool `json:"verbose"` Debug bool `json:"debug"` LogFile string `json:"logfile"` Obfs bool `json:"obfs"` ObfsMethod string `json:"obfsmethod"` ObfsHost []string `json:"obfshost"` ObfsAlive bool `json:"obfsalive"` Limit int `json:"limit"` LimitPerConn int `json:"limitperconn"` LogHTTP bool `json:"loghttp"` Timeout int `json:"timeout"` FilterCapacity int `json:"filtcap"` AutoProxy bool `json:"autoproxy"` ProxyList string `json:"proxylist"` BlackList string `json:"blacklist"` DumpList bool `json:"dumplist"` ChnList string `json:"chnlist"` UseMul bool `json:"usemul"` UseUDP bool `json:"useudp"` Direct bool `json:"direct"` MulConn int `json:"mulconn"` FakeTCPAddr string `json:"faketcpaddr"` Safe bool `json:"safe"` MITM bool `json:"mitm"` DataShard int `json:"datashard"` ParityShard int `json:"parityshard"` SSProxy bool `json:"ssproxy"` Vlogger *log.Logger Dlogger *log.Logger Logger *log.Logger TargetMap map[string]string `json:"target_map"` Ivlen int Any interface{} Die chan bool // contains filtered or unexported fields }
func ReadConfig ¶
func (*Config) CallOnClosed ¶
func (c *Config) CallOnClosed(f cb)
type Conn ¶
func DecayRemainConn ¶
func DialSSWithOptions ¶
func DialSSWithOptions(opt *DialOptions) (conn Conn, err error)
func DialTCPConn ¶
func DialWsConn ¶
type ConnPool ¶
type ConnPool struct {
// contains filtered or unexported fields
}
func NewConnPool ¶
func NewConnPool() *ConnPool
func (*ConnPool) GetNonblock ¶
type DebugConn ¶
type DebugConn struct { Conn // contains filtered or unexported fields }
func NewDebugConn ¶
type DialOptions ¶
type HttpLogConn ¶
type HttpLogConn struct { Conn // contains filtered or unexported fields }
func NewHttpLogConn ¶
func NewHttpLogConn(conn Conn, c *Config) *HttpLogConn
func (*HttpLogConn) Close ¶
func (conn *HttpLogConn) Close() error
type Limiter ¶
type Limiter struct {
// contains filtered or unexported fields
}
func NewLimiter ¶
func (*Limiter) GetTotalBytes ¶
type MultiUDPConn ¶
type MultiUDPConn struct { net.PacketConn // contains filtered or unexported fields }
func ListenMultiUDP ¶
func ListenMultiUDP(c *Config) (*MultiUDPConn, error)
func NewMultiUDPConn ¶
func NewMultiUDPConn(conn net.PacketConn, c *Config) *MultiUDPConn
func (*MultiUDPConn) RemoveAddr ¶
func (c *MultiUDPConn) RemoveAddr(addr net.Addr)
type ObfsConn ¶
type ObfsConn struct { RemainConn // contains filtered or unexported fields }
func NewObfsConn ¶
type RemainConn ¶
type RemainConn struct { Conn // contains filtered or unexported fields }
func GetRemainConn ¶
func GetRemainConn(conn net.Conn) (r *RemainConn, err error)
func (*RemainConn) WriteBuffers ¶
func (c *RemainConn) WriteBuffers(b [][]byte) (n int, err error)
type SimpleHTTPConn ¶
type SimpleHTTPConn struct { Conn // contains filtered or unexported fields }
func (*SimpleHTTPConn) Close ¶
func (conn *SimpleHTTPConn) Close() error
func (*SimpleHTTPConn) WriteBuffers ¶
func (conn *SimpleHTTPConn) WriteBuffers(bufs [][]byte) (n int, err error)
type SimpleTLSConn ¶
type SimpleTLSConn struct { Conn // contains filtered or unexported fields }
func (*SimpleTLSConn) WriteBuffers ¶
func (conn *SimpleTLSConn) WriteBuffers(b [][]byte) (n int, err error)
type UDPConn ¶
type UDPConn struct { net.PacketConn net.Conn // contains filtered or unexported fields }
func NewUDPConn3 ¶
func NewUDPConn3(conn net.PacketConn, c *Config) *UDPConn
func (*UDPConn) RemoteAddr ¶
type UDPTProxyConn ¶
func NewUDPTProxyConn ¶
func NewUDPTProxyConn(conn *net.UDPConn) (*UDPTProxyConn, error)
Click to show internal directories.
Click to hide internal directories.