common

package
v0.0.0-...-b617006 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: AGPL-3.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (
	InitialStreamReceiveWindow     = 2 * 1024 * 1024  // 2 MB
	MaxStreamReceiveWindow         = 32 * 1024 * 1024 // 32 MB
	InitialConnectionReceiveWindow = 32 * 1024 * 1024 // 32 MB
	MaxConnectionReceiveWindow     = 64 * 1024 * 1024 // 64 MB
)

Variables

View Source
var (
	ErrClientClosed       = errors.New("client closed")
	ErrTooManyOpenStreams = errors.New("too many open streams")
	ErrHoldOn             = errors.New("hold on")
)

Functions

func GetUniqueFakeAddrPort

func GetUniqueFakeAddrPort() (fake netip.AddrPort)

func NewSafeStreamConn

func NewSafeStreamConn(stream quic.Stream, lAddr, rAddr net.Addr, closeDeferFn func()) *safeStreamConn

func SetCongestionController

func SetCongestionController(quicConn quic.Connection, cc string, cwnd int)

Types

type Client

type Client interface {
	DialContextWithDialer(ctx context.Context, metadata *protocol.Metadata, dialer netproxy.Dialer, dialFn DialFunc) (netproxy.Conn, error)
	ListenPacketWithDialer(ctx context.Context, metadata *protocol.Metadata, dialer netproxy.Dialer, dialFn DialFunc) (netproxy.PacketConn, error)
	OpenStreams() int64
	Close()
}

type DialFunc

type DialFunc func(ctx context.Context, dialer netproxy.Dialer) (transport *quic.Transport, addr net.Addr, err error)

type UdpRelayMode

type UdpRelayMode uint8
const (
	QUIC UdpRelayMode = iota
	NATIVE
)

Jump to

Keyboard shortcuts

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