quictransport

package
v1.0.256 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package quictransport owns UDP sockets and QUIC connection establishment.

Index

Constants

View Source
const (
	DefaultHandshakeTimeout = 10 * time.Second
	DefaultMaxIdleTimeout   = 30 * time.Second
	DefaultKeepAlivePeriod  = 15 * time.Second
)

Variables

This section is empty.

Functions

func CloneConfig

func CloneConfig(config *quic.Config) *quic.Config

func DefaultConfig

func DefaultConfig() *quic.Config

func EditTransportParameters

func EditTransportParameters(h *quic.ClientHandshake, edit func(*transportparams.Layout))

EditTransportParameters amends a fresh snapshot for each connection, retaining per-attempt randomization without mutating a factory's layout or slices.

func IsGreaseParameter

func IsGreaseParameter(id uint64) bool

The implemented legacy min_ack_delay is a protocol field, despite its residue.

Types

type Dialer

type Dialer struct {
	// OnConnectionStarted observes the prepared UDP path immediately before
	// entering QUIC. It must return promptly and may be called for candidates.
	OnConnectionStarted func(context.Context)

	NetDialer            *net.Dialer
	LookupIPAddr         func(context.Context, string) ([]net.IPAddr, error)
	Proxy                string
	Lazy                 bool
	ResolveAll           bool
	AddressFallbackDelay time.Duration
	ReceivePacketSize    int
	// ReceiveBatchSize selects UDP batch capacity before socket ownership starts.
	ReceiveBatchSize      int
	ConnectionIDLength    int
	ConnectionIDGenerator quic.ConnectionIDGenerator
	DedicatedConn         bool
	// contains filtered or unexported fields
}

Dialer owns UDP sockets and QUIC connection attempts for one HTTP/3 transport. NetDialer preserves the client's resolver pointer; configuration is set before use.

func (*Dialer) Close

func (ut *Dialer) Close()

Close releases the shared UDP transport. HTTP/3 owns application connections.

func (*Dialer) Dial

func (ut *Dialer) Dial(
	ctx context.Context,
	address string,
	tlsConfig *tls.Config,
	config *quic.Config,
	hints []netip.Addr,
) (*quic.Conn, error)

Dial completes the handshake before exposing the connection.

func (*Dialer) DialEarly

func (ut *Dialer) DialEarly(
	ctx context.Context,
	address string,
	tlsConfig *tls.Config,
	config *quic.Config,
	hints []netip.Addr,
) (*quic.Conn, error)

DialEarly allows resumable connections to carry eligible early application data.

func (*Dialer) Init

func (ut *Dialer) Init() error

Init opens a shared UDP socket unless ownership is lazy or per connection.

type ProxyUDPError

type ProxyUDPError struct {
	// contains filtered or unexported fields
}

ProxyUDPError means QUIC never reached the destination. TCP may still be supported by the same SOCKS proxy; cancellation keeps its original meaning.

func (*ProxyUDPError) Error

func (e *ProxyUDPError) Error() string

func (*ProxyUDPError) Unwrap

func (e *ProxyUDPError) Unwrap() error

type ZeroConnectionIDGenerator

type ZeroConnectionIDGenerator struct{}

func (ZeroConnectionIDGenerator) ConnectionIDLen

func (ZeroConnectionIDGenerator) ConnectionIDLen() int

func (ZeroConnectionIDGenerator) GenerateConnectionID

func (ZeroConnectionIDGenerator) GenerateConnectionID() (quic.ConnectionID, error)

Jump to

Keyboard shortcuts

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