Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds HTTP/2 support to Consul's HTTPS server. #3657

Merged
merged 3 commits into from
Nov 7, 2017
Merged

Adds HTTP/2 support to Consul's HTTPS server. #3657

merged 3 commits into from
Nov 7, 2017

Conversation

slackpad
Copy link
Contributor

@slackpad slackpad commented Nov 7, 2017

If TLS is enabled, Consul will now support HTTP/2 for suitably configured clients. This allows them to multiplex multiple requests over the same TCP connection, such as multiple blocking queries. We have not yet made the Go API client default to using HTTP/2, but we've left a TODO to do that in a future major release.

@slackpad slackpad requested a review from preetapan November 7, 2017 04:56
@slackpad
Copy link
Contributor Author

slackpad commented Nov 7, 2017

Tested this with https://github.com/slackpad/consul-live, where the block command has been modified to enable HTTP/2 for the API client. Before this change the number of TCP connections is the same as the number of blocking queries, after it's just a single TCP connection.

@slackpad slackpad merged commit 4a2cafe into master Nov 7, 2017
@slackpad slackpad deleted the h2 branch November 7, 2017 23:07
if err := http2.ConfigureTransport(transport); err != nil {
t.Fatalf("err: %v", err)
}
hc := &http.Client{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason not to wire up http2 transport when tls settings are provided in API client we create for the CLI here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to leave things in the default configuration for now and then flip the API client's default before the next major release, which will turn on HTTP/2 for anything using TLS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants