Versions in this module Expand all Collapse all go1 go1.27.0 Aug 19, 2026 Changes in this version + const ClientPreface + const DefaultMaxHeaderBytes + const NextProtoTLS + const TimeFormat + const TrailerPrefix + var ConnectionStateContextKey = new("ConnectionStateContextKey") + var DebugGoroutines = os.Getenv("DEBUG_HTTP2_GOROUTINES") == "1" + var ErrAbortHandler = internal.ErrAbortHandler + var ErrBodyNotAllowed = internal.ErrBodyNotAllowed + var ErrFrameTooLarge = errors.New("http2: frame too large") + var ErrNoCachedConn error = noCachedConnError + var ErrNotSupported = errors.ErrUnsupported + var ErrPushLimitReached = errors.New("http2: push would exceed peer's SETTINGS_MAX_CONCURRENT_STREAMS") + var ErrRecursivePush = errors.New("http2: recursive push not allowed") + var ErrSkipAltProtocol = internal.ErrSkipAltProtocol + var LocalAddrContextKey any + var NewConnContextKey = new("NewConnContextKey") + var NoBody io.ReadCloser + var VerboseLogs bool + type ClientConn struct + func (cc *ClientConn) CanTakeNewRequest() bool + func (cc *ClientConn) Close() error + func (cc *ClientConn) Ping(ctx context.Context) error + func (cc *ClientConn) ReserveNewRequest() bool + func (cc *ClientConn) RoundTrip(req *ClientRequest) (*ClientResponse, error) + func (cc *ClientConn) SetDoNotReuse() + func (cc *ClientConn) Shutdown(ctx context.Context) error + func (cc *ClientConn) State() ClientConnState + type ClientConnState struct + Closed bool + Closing bool + LastIdle time.Time + MaxConcurrentStreams uint32 + StreamsActive int + StreamsPending int + StreamsReserved int + type ClientRequest struct + Body io.ReadCloser + Cancel <-chan struct{} + Close bool + ContentLength int64 + Context context.Context + GetBody func() (io.ReadCloser, error) + Header Header + Host string + Method string + ResTrailer *Header + Trailer Header + URL *url.URL + func (req *ClientRequest) Clone() *ClientRequest + type ClientResponse struct + Body io.ReadCloser + ContentLength int64 + Header Header + Status string + StatusCode int + TLS *tls.ConnectionState + Trailer Header + Uncompressed bool + type Config struct + CountError func(errType string) + MaxConcurrentStreams int + MaxDecoderHeaderTableSize int + MaxEncoderHeaderTableSize int + MaxReadFrameSize int + MaxReceiveBufferPerConnection int + MaxReceiveBufferPerStream int + PermitProhibitedCipherSuites bool + PingTimeout time.Duration + SendPingTimeout time.Duration + StrictMaxConcurrentRequests bool + WriteByteTimeout time.Duration + type ConnState int + const ConnStateActive + const ConnStateClosed + const ConnStateHijacked + const ConnStateIdle + const ConnStateNew + type ConnectionError ErrCode + func (e ConnectionError) Error() string + type ContinuationFrame struct + func (f *ContinuationFrame) HeaderBlockFragment() []byte + func (f *ContinuationFrame) HeadersEnded() bool + type DataFrame struct + func (f *DataFrame) Data() []byte + func (f *DataFrame) StreamEnded() bool + type ErrCode uint32 + const ErrCodeCancel + const ErrCodeCompression + const ErrCodeConnect + const ErrCodeEnhanceYourCalm + const ErrCodeFlowControl + const ErrCodeFrameSize + const ErrCodeHTTP11Required + const ErrCodeInadequateSecurity + const ErrCodeInternal + const ErrCodeNo + const ErrCodeProtocol + const ErrCodeRefusedStream + const ErrCodeSettingsTimeout + const ErrCodeStreamClosed + func (e ErrCode) String() string + type Flags uint8 + const FlagContinuationEndHeaders + const FlagDataEndStream + const FlagDataPadded + const FlagHeadersEndHeaders + const FlagHeadersEndStream + const FlagHeadersPadded + const FlagHeadersPriority + const FlagPingAck + const FlagPushPromiseEndHeaders + const FlagPushPromisePadded + const FlagSettingsAck + func (f Flags) Has(v Flags) bool + type Frame interface + Header func() FrameHeader + type FrameHeader struct + Flags Flags + Length uint32 + StreamID uint32 + Type FrameType + func ReadFrameHeader(r io.Reader) (FrameHeader, error) + func (h FrameHeader) Header() FrameHeader + func (h FrameHeader) String() string + type FrameType uint8 + const FrameContinuation + const FrameData + const FrameGoAway + const FrameHeaders + const FramePing + const FramePriority + const FramePriorityUpdate + const FramePushPromise + const FrameRSTStream + const FrameSettings + const FrameWindowUpdate + func (t FrameType) String() string + type FrameWriteRequest struct + func (wr FrameWriteRequest) Consume(n int32) (FrameWriteRequest, FrameWriteRequest, int) + func (wr FrameWriteRequest) DataSize() int + func (wr FrameWriteRequest) StreamID() uint32 + func (wr FrameWriteRequest) String() string + type Framer struct + AllowIllegalReads bool + AllowIllegalWrites bool + MaxHeaderListSize uint32 + MaxHeaderValueCount int + ReadMetaHeaders *hpack.Decoder + func NewFramer(w io.Writer, r io.Reader) *Framer + func (f *Framer) WriteContinuation(streamID uint32, endHeaders bool, headerBlockFragment []byte) error + func (f *Framer) WriteData(streamID uint32, endStream bool, data []byte) error + func (f *Framer) WriteDataPadded(streamID uint32, endStream bool, data, pad []byte) error + func (f *Framer) WriteGoAway(maxStreamID uint32, code ErrCode, debugData []byte) error + func (f *Framer) WriteHeaders(p HeadersFrameParam) error + func (f *Framer) WritePing(ack bool, data [8]byte) error + func (f *Framer) WritePriority(streamID uint32, p PriorityParam) error + func (f *Framer) WritePriorityUpdate(streamID uint32, priority string) error + func (f *Framer) WritePushPromise(p PushPromiseParam) error + func (f *Framer) WriteRSTStream(streamID uint32, code ErrCode) error + func (f *Framer) WriteRawFrame(t FrameType, flags Flags, streamID uint32, payload []byte) error + func (f *Framer) WriteSettings(settings ...Setting) error + func (f *Framer) WriteSettingsAck() error + func (f *Framer) WriteWindowUpdate(streamID, incr uint32) error + func (fr *Framer) ErrorDetail() error + func (fr *Framer) ReadFrame() (Frame, error) + func (fr *Framer) ReadFrameForHeader(fh FrameHeader) (Frame, error) + func (fr *Framer) ReadFrameHeader() (FrameHeader, error) + func (fr *Framer) SetMaxReadFrameSize(v uint32) + func (fr *Framer) SetReuseFrames() + type GoAwayError struct + DebugData string + ErrCode ErrCode + LastStreamID uint32 + func (e GoAwayError) Error() string + type GoAwayFrame struct + ErrCode ErrCode + LastStreamID uint32 + func (f *GoAwayFrame) DebugData() []byte + type Handler interface + ServeHTTP func(*ResponseWriter, *ServerRequest) + type Header = textproto.MIMEHeader + type HeadersFrame struct + Priority PriorityParam + func (f *HeadersFrame) HasPriority() bool + func (f *HeadersFrame) HeaderBlockFragment() []byte + func (f *HeadersFrame) HeadersEnded() bool + func (f *HeadersFrame) StreamEnded() bool + type HeadersFrameParam struct + BlockFragment []byte + EndHeaders bool + EndStream bool + PadLength uint8 + Priority PriorityParam + StreamID uint32 + type MetaHeadersFrame struct + Fields []hpack.HeaderField + Truncated bool + func (mh *MetaHeadersFrame) PseudoFields() []hpack.HeaderField + func (mh *MetaHeadersFrame) PseudoValue(pseudo string) string + func (mh *MetaHeadersFrame) RegularFields() []hpack.HeaderField + type NetHTTPClientConn struct + func (cc NetHTTPClientConn) Available() int + func (cc NetHTTPClientConn) Close() error + func (cc NetHTTPClientConn) Err() error + func (cc NetHTTPClientConn) InFlight() int + func (cc NetHTTPClientConn) Ping(ctx context.Context) error + func (cc NetHTTPClientConn) Release() + func (cc NetHTTPClientConn) Reserve() error + func (cc NetHTTPClientConn) RoundTrip(req *ClientRequest) (*ClientResponse, error) + type OpenStreamOptions struct + PusherID uint32 + type PingFrame struct + Data [8]byte + func (f *PingFrame) IsAck() bool + type PriorityFrame struct + type PriorityParam struct + Exclusive bool + StreamDep uint32 + Weight uint8 + func (p PriorityParam) IsZero() bool + type PriorityUpdateFrame struct + PrioritizedStreamID uint32 + Priority string + type PushOptions struct + Header Header + Method string + type PushPromiseFrame struct + PromiseID uint32 + func (f *PushPromiseFrame) HeaderBlockFragment() []byte + func (f *PushPromiseFrame) HeadersEnded() bool + type PushPromiseParam struct + BlockFragment []byte + EndHeaders bool + PadLength uint8 + PromiseID uint32 + StreamID uint32 + type RSTStreamFrame struct + ErrCode ErrCode + type ResponseWriter = responseWriter + type RoundTripOpt struct + OnlyCachedConn bool + type ServeConnOpts struct + BaseConfig ServerConfig + Context context.Context + Handler Handler + SawClientPreface bool + Settings []byte + UpgradeRequest *ServerRequest + type Server struct + func (s *Server) Configure(conf ServerConfig, tcfg *tls.Config) error + func (s *Server) GracefulShutdown() + func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) + type ServerConfig interface + ConnState func(net.Conn, ConnState) + DisableClientPriority func() bool + DoKeepAlives func() bool + ErrorLog func() *log.Logger + HTTP2Config func() Config + IdleTimeout func() time.Duration + MaxHeaderBytes func() int + MaxHeaderValueCount func() int + ReadTimeout func() time.Duration + SendPingTimeout func() time.Duration + WriteTimeout func() time.Duration + type ServerRequest struct + Body io.ReadCloser + ContentLength int64 + Context context.Context + Header Header + Host string + Method string + MultipartForm *multipart.Form + Proto string + ProtoMajor int + ProtoMinor int + RemoteAddr string + RequestURI string + TLS *tls.ConnectionState + Trailer Header + URL *url.URL + type Setting struct + ID SettingID + Val uint32 + func (s Setting) String() string + func (s Setting) Valid() error + type SettingID uint16 + const SettingEnableConnectProtocol + const SettingEnablePush + const SettingHeaderTableSize + const SettingInitialWindowSize + const SettingMaxConcurrentStreams + const SettingMaxFrameSize + const SettingMaxHeaderListSize + const SettingNoRFC7540Priorities + func (s SettingID) String() string + type SettingsFrame struct + func (f *SettingsFrame) ForeachSetting(fn func(Setting) error) error + func (f *SettingsFrame) HasDuplicates() bool + func (f *SettingsFrame) IsAck() bool + func (f *SettingsFrame) NumSettings() int + func (f *SettingsFrame) Setting(i int) Setting + func (f *SettingsFrame) Value(id SettingID) (v uint32, ok bool) + type StreamError struct + Cause error + Code ErrCode + StreamID uint32 + func (e StreamError) As(target any) bool + func (e StreamError) Error() string + type Transport struct + func NewTransport(t1 TransportConfig) *Transport + func (t *Transport) AddConn(scheme, authority string, c net.Conn) error + func (t *Transport) CloseIdleConnections() + func (t *Transport) IdleConnStrsForTesting() []string + func (t *Transport) NewClientConn(c net.Conn, internalStateHook func()) (NetHTTPClientConn, error) + func (t *Transport) RoundTrip(req *ClientRequest) (*ClientResponse, error) + func (t *Transport) RoundTripOpt(req *ClientRequest, opt RoundTripOpt) (*ClientResponse, error) + type TransportConfig interface + DisableCompression func() bool + DisableKeepAlives func() bool + ExpectContinueTimeout func() time.Duration + HTTP2Config func() Config + IdleConnTimeout func() time.Duration + MaxHeaderListSize func() int64 + MaxResponseHeaderBytes func() int64 + ResponseHeaderTimeout func() time.Duration + type UnknownFrame struct + func (f *UnknownFrame) Payload() []byte + type WindowUpdateFrame struct + Increment uint32 + type WriteScheduler interface + AdjustStream func(streamID uint32, priority PriorityParam) + CloseStream func(streamID uint32) + OpenStream func(streamID uint32, options OpenStreamOptions) + Pop func() (wr FrameWriteRequest, ok bool) + Push func(wr FrameWriteRequest) go1.27rc3 Aug 13, 2026 go1.27rc2 Jul 7, 2026 GO-2026-5026 GO-2026-5026: Invoking failure to reject ASCII-only Punycode-encoded labels in golang.org/x/net/idna go1.27rc1 Jun 18, 2026 GO-2026-5026 GO-2026-5026: Invoking failure to reject ASCII-only Punycode-encoded labels in golang.org/x/net/idna