Documentation
¶
Index ¶
- Variables
- func Accept(l net.Listener, f func(c net.Conn))
- func BuildProxyProtocolHeader(c net.Conn, proxyProtocol int) []byte
- func BuildProxyProtocolHeaderByAddr(clientAddr, targetAddr *net.TCPAddr, proxyProtocol int) []byte
- func BuildProxyProtocolV1Header(clientAddr, targetAddr *net.TCPAddr) []byte
- func BuildProxyProtocolV2Header(clientAddr, targetAddr *net.TCPAddr) []byte
- func CopyWaitGroup(conn1, conn2 net.Conn, crypt bool, snappy bool, rate *rate.Rate, ...)
- func DialWS(rawConn net.Conn, urlStr string, timeout time.Duration) (*websocket.Conn, *http.Response, error)
- func DialWSS(rawConn net.Conn, urlStr string, timeout time.Duration) (*websocket.Conn, *http.Response, error)
- func GetConn(conn net.Conn, cpt, snappy bool, rt *rate.Rate, isServer bool) io.ReadWriteCloser
- func GetLenBytes(buf []byte) (b []byte, err error)
- func NewKcpListenerAndProcess(addr string, f func(c net.Conn)) error
- func NewTcpListenerAndProcess(addr string, f func(c net.Conn), listener *net.Listener) error
- func NewWSListener(base net.Listener, path string) net.Listener
- func NewWSSListener(base net.Listener, path string, cert tls.Certificate) net.Listener
- func SetUdpSession(sess *kcp.UDPSession)
- type Conn
- func (s *Conn) Close() error
- func (s *Conn) GetAddStatus() (b bool)
- func (s *Conn) GetConfigInfo() (c *file.Client, err error)
- func (s *Conn) GetHealthInfo() (info string, status bool, err error)
- func (s *Conn) GetHost() (method, address string, rb []byte, err error, r *http.Request)
- func (s *Conn) GetHostInfo() (h *file.Host, err error)
- func (s *Conn) GetLen() (int, error)
- func (s *Conn) GetLinkInfo() (lk *Link, err error)
- func (s *Conn) GetShortContent(l int) (b []byte, err error)
- func (s *Conn) GetShortLenContent() (b []byte, err error)
- func (s *Conn) GetTaskInfo() (t *file.Tunnel, err error)
- func (s *Conn) LocalAddr() net.Addr
- func (s *Conn) Read(b []byte) (n int, err error)
- func (s *Conn) ReadFlag() (string, error)
- func (s *Conn) ReadLen(cLen int, buf []byte) (int, error)
- func (s *Conn) RemoteAddr() net.Addr
- func (s *Conn) SendHealthInfo(info, status string) (int, error)
- func (s *Conn) SendInfo(t interface{}, flag string) (int, error)
- func (s *Conn) SetAlive()
- func (s *Conn) SetDeadline(t time.Time) error
- func (s *Conn) SetReadDeadline(t time.Time) error
- func (s *Conn) SetReadDeadlineBySecond(t time.Duration)
- func (s *Conn) SetWriteDeadline(t time.Time) error
- func (s *Conn) Write(b []byte) (int, error)
- func (s *Conn) WriteAddFail() error
- func (s *Conn) WriteAddOk() error
- func (s *Conn) WriteChan() (int, error)
- func (s *Conn) WriteClose() (int, error)
- func (s *Conn) WriteConfig() (int, error)
- func (s *Conn) WriteLenContent(buf []byte) (err error)
- func (s *Conn) WriteMain() (int, error)
- type FlowConn
- type LenConn
- type Link
- type OneConnListener
- type Option
- type Options
- type RWConn
- type Secret
- type SnappyConn
- type TlsConn
- func (c *TlsConn) Close() error
- func (c *TlsConn) GetRawConn() net.Conn
- func (c *TlsConn) LocalAddr() net.Addr
- func (c *TlsConn) Read(b []byte) (n int, err error)
- func (c *TlsConn) RemoteAddr() net.Addr
- func (c *TlsConn) SetDeadline(t time.Time) error
- func (c *TlsConn) SetReadDeadline(t time.Time) error
- func (c *TlsConn) SetWriteDeadline(t time.Time) error
- func (c *TlsConn) Write(b []byte) (n int, err error)
- type WsConn
- func (c *WsConn) Close() error
- func (c *WsConn) LocalAddr() net.Addr
- func (c *WsConn) Read(p []byte) (int, error)
- func (c *WsConn) RemoteAddr() net.Addr
- func (c *WsConn) SetDeadline(t time.Time) error
- func (c *WsConn) SetReadDeadline(t time.Time) error
- func (c *WsConn) SetWriteDeadline(t time.Time) error
- func (c *WsConn) Write(p []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var LocalTCPAddr = &net.TCPAddr{IP: net.ParseIP("127.0.0.1")}
Functions ¶
func BuildProxyProtocolHeader ¶
构造 Proxy Protocol 头部
func BuildProxyProtocolV1Header ¶
构造 Proxy Protocol v1 头部
func BuildProxyProtocolV2Header ¶
构造 Proxy Protocol v2 头部
func CopyWaitGroup ¶
func CopyWaitGroup(conn1, conn2 net.Conn, crypt bool, snappy bool, rate *rate.Rate, flows []*file.Flow, isServer bool, proxyProtocol int, rb []byte, task *file.Tunnel)
conn1 mux conn
func GetLenBytes ¶
get the assembled amount data(len 4 and content)
func NewWSSListener ¶
Types ¶
type Conn ¶
func (*Conn) GetConfigInfo ¶
get task info
func (*Conn) GetHealthInfo ¶
get health info from conn
func (*Conn) GetLinkInfo ¶
get link info from conn
func (*Conn) GetShortLenContent ¶
func (*Conn) RemoteAddr ¶
func (*Conn) SendHealthInfo ¶
send info for link
func (*Conn) SetReadDeadlineBySecond ¶
set read deadline
func (*Conn) WriteAddFail ¶
func (*Conn) WriteAddOk ¶
func (*Conn) WriteLenContent ¶
type FlowConn ¶
type FlowConn struct { *RWConn // contains filtered or unexported fields }
func NewFlowConn ¶
func NewFlowConn(conn io.ReadWriteCloser, task, client *file.Flow) *FlowConn
type LenConn ¶
type LenConn struct { Len int // contains filtered or unexported fields }
func NewLenConn ¶
type Link ¶
type OneConnListener ¶
type OneConnListener struct {
// contains filtered or unexported fields
}
func NewOneConnListener ¶
func NewOneConnListener(c net.Conn) *OneConnListener
func (*OneConnListener) Addr ¶
func (l *OneConnListener) Addr() net.Addr
func (*OneConnListener) Close ¶
func (l *OneConnListener) Close() error
type RWConn ¶
type RWConn struct { io.ReadWriteCloser FakeAddr net.Addr }
func NewRWConn ¶
func NewRWConn(conn io.ReadWriteCloser) *RWConn
func (*RWConn) RemoteAddr ¶
type SnappyConn ¶
type SnappyConn struct {
// contains filtered or unexported fields
}
func NewSnappyConn ¶
func NewSnappyConn(conn io.ReadWriteCloser) *SnappyConn
func (*SnappyConn) Close ¶
func (s *SnappyConn) Close() error
type WsConn ¶
func (*WsConn) RemoteAddr ¶
Click to show internal directories.
Click to hide internal directories.