package http3

import "golang.org/x/net/internal/http3"

Package http3 implements the HTTP/3 protocol.

This package is a work in progress. It is not ready for production usage. Its API is subject to change without notice.

Index

Types

type ClientConn

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

A ClientConn is a client HTTP/3 connection.

Multiple goroutines may invoke methods on a ClientConn simultaneously.

func (*ClientConn) Close

func (cc *ClientConn) Close() error

Close closes the connection. Any in-flight requests are canceled. Close does not wait for the peer to acknowledge the connection closing.

func (*ClientConn) RoundTrip

func (cc *ClientConn) RoundTrip(req *http.Request) (_ *http.Response, err error)

RoundTrip sends a request on the connection.

type Server

type Server struct {
	// Handler to invoke for requests, http.DefaultServeMux if nil.
	Handler http.Handler

	// Config is the QUIC configuration used by the server.
	// The Config may be nil.
	//
	// ListenAndServe may clone and modify the Config.
	// The Config must not be modified after calling ListenAndServe.
	Config *quic.Config
	// contains filtered or unexported fields
}

A Server is an HTTP/3 server. The zero value for Server is a valid server.

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(addr string) error

ListenAndServe listens on the UDP network address addr and then calls Serve to handle requests on incoming connections.

func (*Server) Serve

func (s *Server) Serve(e *quic.Endpoint) error

Serve accepts incoming connections on the QUIC endpoint e, and handles requests from those connections.

type Transport

type Transport struct {
	// Endpoint is the QUIC endpoint used by connections created by the transport.
	// If unset, it is initialized by the first call to Dial.
	Endpoint *quic.Endpoint

	// Config is the QUIC configuration used for client connections.
	// The Config may be nil.
	//
	// Dial may clone and modify the Config.
	// The Config must not be modified after calling Dial.
	Config *quic.Config
	// contains filtered or unexported fields
}

A Transport is an HTTP/3 transport.

It does not manage a pool of connections, and therefore does not implement net/http.RoundTripper.

TODO: Provide a way to register an HTTP/3 transport with a net/http.Transport's connection pool.

func (*Transport) Dial

func (tr *Transport) Dial(ctx context.Context, target string) (*ClientConn, error)

Dial creates a new HTTP/3 client connection.

Source Files

body.go conn.go doc.go errors.go http3.go qpack.go qpack_decode.go qpack_encode.go qpack_static.go quic.go roundtrip.go server.go settings.go stream.go transport.go

Version
v0.49.0
Published
Jan 12, 2026
Platform
linux/amd64
Imports
13 packages
Last checked
37 minutes ago

Tools for package owners.