Documentation ¶
Index ¶
- Variables
- func MaskWebSocket(key uint32, b []byte) uint32
- func NeedHandshake(conn any) bool
- func NewBindPacketConn(pc net.PacketConn, rAddr net.Addr) net.Conn
- func NewEarlyConn(c net.Conn, f func() error) net.Conn
- func NewRefConn(conn net.Conn, ref any) net.Conn
- func ParseCert(certificate, privateKey string, path Path) (tls.Certificate, error)
- func Relay(leftConn, rightConn net.Conn)
- func SetupContextForConn(ctx context.Context, conn net.Conn) (done func(*error))
- func SplitHostPort(s string) (host, port string, hasPort bool, err error)
- func SplitNetworkType(s string) (string, string, error)
- func TCPKeepAlive(c net.Conn)
- func WarpConnWithBioReader(c net.Conn, br *bufio.Reader) net.Conn
- type BufferedConn
- func (c *BufferedConn) AppendData(buf []byte) (ok bool)
- func (c *BufferedConn) Buffered() int
- func (c *BufferedConn) Discard(n int) (discarded int, err error)
- func (c *BufferedConn) Peek(n int) ([]byte, error)
- func (c *BufferedConn) Peeked() bool
- func (c *BufferedConn) Read(p []byte) (int, error)
- func (c *BufferedConn) ReadBuffer(buffer *buf.Buffer) (err error)
- func (c *BufferedConn) ReadByte() (byte, error)
- func (c *BufferedConn) ReadCached() *buf.Buffer
- func (c *BufferedConn) Reader() *bufio.Reader
- func (c *BufferedConn) ReaderReplaceable() bool
- func (c *BufferedConn) ResetPeeked()
- func (c *BufferedConn) UnreadByte() error
- func (c *BufferedConn) Upstream() any
- func (c *BufferedConn) WriterReplaceable() bool
- type CachedConn
- type CountFunc
- type CustomAddr
- type EnhancePacketConn
- type ExtendedConn
- type ExtendedReader
- type ExtendedWriter
- type Path
- type ReadOnlyReader
- type WaitReadFrom
- type WriteOnlyWriter
Constants ¶
This section is empty.
Variables ¶
View Source
var KeepAliveInterval = 15 * time.Second
View Source
var NewDeadlineEnhancePacketConn = deadline.NewEnhancePacketConn
View Source
var NewDeadlineEnhanceSingPacketConn = deadline.NewEnhanceSingPacketConn
View Source
var NewDeadlineNetPacketConn = deadline.NewNetPacketConn
View Source
var NewDeadlineSingPacketConn = deadline.NewSingPacketConn
View Source
var NewEnhancePacketConn = packet.NewEnhancePacketConn
View Source
var NewExtendedConn = bufio.NewExtendedConn
View Source
var NewExtendedReader = bufio.NewExtendedReader
View Source
var NewExtendedWriter = bufio.NewExtendedWriter
View Source
var NewRefPacketConn = packet.NewRefPacketConn
View Source
var NewThreadSafePacketConn = packet.NewThreadSafePacketConn
View Source
var Pipe = deadline.Pipe
View Source
var WriteBuffer = bufio.WriteBuffer
Functions ¶
func MaskWebSocket ¶
MaskWebSocket applies the WebSocket masking algorithm to p with the given key. See https://tools.ietf.org/html/rfc6455#section-5.3
The returned value is the correctly rotated key to to continue to mask/unmask the message.
It is optimized for LittleEndian and expects the key to be in little endian.
func NeedHandshake ¶
func NewBindPacketConn ¶
func SetupContextForConn ¶
SetupContextForConn is a helper function that starts connection I/O interrupter goroutine.
func TCPKeepAlive ¶
Types ¶
type BufferedConn ¶
type BufferedConn struct { ExtendedConn // contains filtered or unexported fields }
func NewBufferedConn ¶
func NewBufferedConn(c net.Conn) *BufferedConn
func (*BufferedConn) AppendData ¶
func (c *BufferedConn) AppendData(buf []byte) (ok bool)
func (*BufferedConn) Buffered ¶
func (c *BufferedConn) Buffered() int
func (*BufferedConn) Peek ¶
func (c *BufferedConn) Peek(n int) ([]byte, error)
Peek returns the next n bytes without advancing the reader.
func (*BufferedConn) Peeked ¶
func (c *BufferedConn) Peeked() bool
func (*BufferedConn) ReadBuffer ¶
func (c *BufferedConn) ReadBuffer(buffer *buf.Buffer) (err error)
func (*BufferedConn) ReadByte ¶
func (c *BufferedConn) ReadByte() (byte, error)
func (*BufferedConn) ReadCached ¶
func (c *BufferedConn) ReadCached() *buf.Buffer
func (*BufferedConn) Reader ¶
func (c *BufferedConn) Reader() *bufio.Reader
Reader returns the internal bufio.Reader.
func (*BufferedConn) ReaderReplaceable ¶
func (c *BufferedConn) ReaderReplaceable() bool
func (*BufferedConn) ResetPeeked ¶
func (c *BufferedConn) ResetPeeked()
func (*BufferedConn) UnreadByte ¶
func (c *BufferedConn) UnreadByte() error
func (*BufferedConn) Upstream ¶
func (c *BufferedConn) Upstream() any
func (*BufferedConn) WriterReplaceable ¶
func (c *BufferedConn) WriterReplaceable() bool
type CachedConn ¶
type CachedConn struct { ExtendedConn // contains filtered or unexported fields }
func NewCachedConn ¶
func NewCachedConn(c net.Conn, data []byte) *CachedConn
func (*CachedConn) ReadCached ¶
func (c *CachedConn) ReadCached() *buf.Buffer
func (*CachedConn) ReaderReplaceable ¶
func (c *CachedConn) ReaderReplaceable() bool
func (*CachedConn) Upstream ¶
func (c *CachedConn) Upstream() any
func (*CachedConn) WriterReplaceable ¶
func (c *CachedConn) WriterReplaceable() bool
type CustomAddr ¶
func NewCustomAddr ¶
func NewCustomAddr(networkStr string, addrStr string, rawAddr net.Addr) CustomAddr
type EnhancePacketConn ¶
type EnhancePacketConn = packet.EnhancePacketConn
type ExtendedConn ¶
type ExtendedConn = network.ExtendedConn
func NewDeadlineConn ¶
func NewDeadlineConn(conn net.Conn) ExtendedConn
type ExtendedReader ¶
type ExtendedReader = network.ExtendedReader
type ExtendedWriter ¶
type ExtendedWriter = network.ExtendedWriter
type ReadOnlyReader ¶
type WaitReadFrom ¶
type WaitReadFrom = packet.WaitReadFrom
type WriteOnlyWriter ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.