Skip to content

proposal: x/net/http2: add EnableConnectProtocol to Server #72071

@WeidiDeng

Description

@WeidiDeng

Proposal Details

In this accepted proposal a new field is added to http.HTTP2Config to allow the h2 server to declare Extended Connect support without explicitly importing x/net/http2 package.

However, currently h2 package uses a global debug env http2xconnect to control this setting.

Given that other fields in http.HTTP2Config have a corresponding field in http2.Server, and this config is merged with h2 configurations, I propose we remove http2xconnect debug environmental variable and add a new dedicated field EnableConnectProtocol to control whether extended connect is enabled.

By default this field is false, so websocket connection made by clients still uses h1 upgrade mechanism, thus backward compatible. Extended connect support has to be enabled explicitly by the user.

This proposal only adds a new API, so there is no breaking change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    LibraryProposalIssues describing a requested change to the Go standard library or x/ libraries, but not to a toolProposal

    Type

    No type

    Projects

    Status

    Incoming

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions