...

Package http3

import "vendor/golang.org/x/net/internal/http3"
Overview
Index

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.

func RegisterServer

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

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)

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

type ServerOpts

type ServerOpts struct {
    // ListenQUIC determines how the server will open a QUIC endpoint.
    // By default, quic.Listen("udp", addr, config) is used.
    ListenQUIC func(addr string, config *quic.Config) (*quic.Endpoint, error)

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

    // QUICConfig is the QUIC configuration used by the transport.
    // QUICConfig may be nil and should not be modified after calling
    // RegisterTransport.
    // If QUICConfig.TLSConfig is nil, the TLSConfig of the net/http Transport
    // given to RegisterTransport will be used.
    QUICConfig *quic.Config
}