http3

package
v0.58.4-vibetls Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: BSD-3-Clause Imports: 27 Imported by: 0

Documentation

Overview

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.

Copyright 2026 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterServer

func RegisterServer(s *http.Server, opts ServerOpts) error

RegisterServer adds HTTP/3 support to a net/http Server.

RegisterServer must be called before s begins serving, and only affects s.ListenAndServeTLS.

func RegisterTransport

func RegisterTransport(tr *http.Transport, opts TransportOpts) error

RegisterTransport configures a net/http HTTP/1 Transport to use HTTP/3.

Types

type ServerOpts

type ServerOpts struct {
	// QUICConfig is the QUIC configuration used by the server.
	// QUICConfig may be nil and should not be modified after calling
	// RegisterServer.
	// If QUICConfig.TLSConfig is nil, the TLSConfig of the net/http Server
	// given to RegisterServer will be used.
	QUICConfig *quic.Config
}

type TransportOpts

type TransportOpts struct {
	// ListenQUIC determines how the transport will open a QUIC endpoint.
	// By default, quic.Listen("udp", addr, config) is used.
	// ListenQUIC might be called multiple times.
	ListenQUIC func(addr string, config *quic.Config) (*quic.Endpoint, error)

	// ListenPacket specifies the function for creating a UDP listener.
	// If ListenPacket is nil, then the transport listens using net.ListenPacket.
	//
	// If ListenQUIC and ListenPacket are both set, ListenQUIC takes priority.
	ListenPacket func(network, addr string) (net.PacketConn, error)

	// QUICConfig is the QUIC configuration used by the transport.
	// QUICConfig may be nil and should not be modified after calling
	// RegisterTransport.
	//
	// The QUICConfig's TLSConfig is not used.
	// Set the TLSConfig on the net/http Transport instead.
	QUICConfig *quic.Config
}

Jump to

Keyboard shortcuts

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