net

package
v0.0.0-...-45a9176 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2024 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NewExtendedConn = bufio.NewExtendedConn
View Source
var NewExtendedReader = bufio.NewExtendedReader
View Source
var NewExtendedWriter = bufio.NewExtendedWriter

Functions

func MaskWebSocket

func MaskWebSocket(key uint32, b []byte) uint32

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.

See https://github.com/golang/go/issues/31586

func NewBindPacketConn

func NewBindPacketConn(pc net.PacketConn, rAddr net.Addr) net.Conn

func NewRefConn

func NewRefConn(conn net.Conn, ref any) net.Conn

func NewRefPacketConn

func NewRefPacketConn(pc net.PacketConn, ref any) net.PacketConn

func ParseCert

func ParseCert(certificate, privateKey string) (tls.Certificate, error)

func Relay

func Relay(leftConn, rightConn net.Conn)

Relay copies between left and right bidirectionally.

func SplitHostPort

func SplitHostPort(s string) (host, port string, hasPort bool, err error)

func SplitNetworkType

func SplitNetworkType(s string) (string, string, error)

Types

type BufferedConn

type BufferedConn struct {
	ExtendedConn
	// contains filtered or unexported fields
}

func NewBufferedConn

func NewBufferedConn(c net.Conn) *BufferedConn

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) Read

func (c *BufferedConn) Read(p []byte) (int, error)

func (*BufferedConn) ReadBuffer

func (c *BufferedConn) ReadBuffer(buffer *buf.Buffer) (err error)

func (*BufferedConn) ReadByte

func (c *BufferedConn) ReadByte() (byte, error)

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) UnreadByte

func (c *BufferedConn) UnreadByte() error

func (*BufferedConn) Upstream

func (c *BufferedConn) Upstream() any

type ExtendedConn

type ExtendedConn = network.ExtendedConn

type ExtendedReader

type ExtendedReader = network.ExtendedReader

type ExtendedWriter

type ExtendedWriter = network.ExtendedWriter

type ReadOnlyReader

type ReadOnlyReader struct {
	io.Reader
}

type WriteOnlyWriter

type WriteOnlyWriter struct {
	io.Writer
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL