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.Addr, proxyProtocol int) []byte
- func BuildProxyProtocolV1Header(clientAddr, targetAddr net.Addr) []byte
- func BuildProxyProtocolV2Header(clientAddr, targetAddr net.Addr) []byte
- func CheckFlowLimits(f *file.Flow, label string, now time.Time) error
- 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 GetTlsConn(c net.Conn, sni string) (net.Conn, error)
- func NewKcpListenerAndProcess(addr string, f func(c net.Conn)) error
- func NewQuicListenerAndProcess(addr string, tlsConfig *tls.Config, 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 QuicConn
- func (q *QuicConn) Close() error
- func (q *QuicConn) LocalAddr() net.Addr
- func (q *QuicConn) Read(p []byte) (int, error)
- func (q *QuicConn) RemoteAddr() net.Addr
- func (q *QuicConn) SetDeadline(t time.Time) error
- func (q *QuicConn) SetReadDeadline(t time.Time) error
- func (q *QuicConn) SetWriteDeadline(t time.Time) error
- func (q *QuicConn) Write(p []byte) (int, error)
- 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 头 (TCP / UDP)
func BuildProxyProtocolV2Header ¶
构造 Proxy-Protocol v2 头 (TCP / UDP)
func CheckFlowLimits ¶ added in v0.29.25
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 NewQuicListenerAndProcess ¶ added in v0.29.26
func NewWSListener ¶ added in v0.27.0
func NewWSSListener ¶ added in v0.27.0
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 ¶ added in v0.28.3
type FlowConn struct {
*RWConn
// contains filtered or unexported fields
}
func NewFlowConn ¶ added in v0.28.3
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 ¶ added in v0.28.3
type OneConnListener struct {
// contains filtered or unexported fields
}
func NewOneConnListener ¶ added in v0.28.3
func NewOneConnListener(c net.Conn) *OneConnListener
func (*OneConnListener) Accept ¶ added in v0.28.3
func (l *OneConnListener) Accept() (net.Conn, error)
func (*OneConnListener) Addr ¶ added in v0.28.3
func (l *OneConnListener) Addr() net.Addr
func (*OneConnListener) Close ¶ added in v0.28.3
func (l *OneConnListener) Close() error
type QuicConn ¶ added in v0.29.26
type QuicConn struct {
// contains filtered or unexported fields
}
func NewQuicConn ¶ added in v0.29.26
func (*QuicConn) RemoteAddr ¶ added in v0.29.26
func (*QuicConn) SetReadDeadline ¶ added in v0.29.26
func (*QuicConn) SetWriteDeadline ¶ added in v0.29.26
type RWConn ¶ added in v0.28.3
type RWConn struct {
io.ReadWriteCloser
FakeAddr net.Addr
}
func NewRWConn ¶ added in v0.28.3
func NewRWConn(conn io.ReadWriteCloser) *RWConn
func (*RWConn) RemoteAddr ¶ added in v0.28.3
func (*RWConn) SetReadDeadline ¶ added in v0.28.3
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 TlsConn ¶ added in v0.26.48
func NewTlsConn ¶ added in v0.26.48
func (*TlsConn) GetRawConn ¶ added in v0.26.48
func (*TlsConn) RemoteAddr ¶ added in v0.26.48
func (*TlsConn) SetReadDeadline ¶ added in v0.26.48
func (*TlsConn) SetWriteDeadline ¶ added in v0.26.48
type WsConn ¶ added in v0.28.3
func (*WsConn) RemoteAddr ¶ added in v0.28.3
func (*WsConn) SetReadDeadline ¶ added in v0.28.3
func (*WsConn) SetWriteDeadline ¶ added in v0.28.3
Click to show internal directories.
Click to hide internal directories.