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 h2c support #1868

Closed
wants to merge 1 commit into from
Closed

Adds h2c support #1868

wants to merge 1 commit into from

Conversation

AlexanderYastrebov
Copy link
Member

@AlexanderYastrebov AlexanderYastrebov commented Oct 1, 2021

Enables HTTP/2 connections over cleartext TCP with Prior Knowledge (RFC 7540 3.4).

The implementation is based on the golang.org/x/net/http2/h2c and workarounds several issues:

See h2c package docs for details.

Signed-off-by: Alexander Yastrebov [email protected]

h2c/h2c.go Outdated Show resolved Hide resolved
@szuecs
Copy link
Member

szuecs commented Oct 14, 2021

👍

@szuecs
Copy link
Member

szuecs commented Oct 14, 2021

From my side great first step to support h2c as a server handler!

Enables HTTP/2 connections over cleartext TCP with Prior Knowledge (RFC 7540 3.4).

The implementation is based on the golang.org/x/net/http2/h2c and workarounds several issues:
* golang/go#38064
* golang/go#26682

See h2c package docs for details.

Signed-off-by: Alexander Yastrebov <[email protected]>
@tsingson
Copy link

From my side great first step to support h2c as a server handler!

any update about h2c ?

@szuecs
Copy link
Member

szuecs commented Sep 12, 2022

@tsingson I think we should wait for golang/net#139 being merged and released, if not it's not reasonable to have h2c support in Go.

@tsingson
Copy link

@tsingson I think we should wait for golang/net#139 being merged and released, if not it's not reasonable to have h2c support in Go.

thanks for update.

@tsingson
Copy link

https://go-review.googlesource.com/c/net/+/419181

good news.

Comment on lines +131 to +149
func (h *h2cHandler) Shutdown(ctx context.Context) error {
serr := h.s1.Shutdown(ctx)

timer := time.NewTicker(500 * time.Millisecond)
defer timer.Stop()
for {
n := atomic.LoadInt64(&h.conns)
log.Debugf("h2c shutdown: %d connections", n)

if n == 0 {
return serr
}
select {
case <-ctx.Done():
return ctx.Err()
case <-timer.C:
}
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

@AlexanderYastrebov
Copy link
Member Author

AlexanderYastrebov commented Jul 12, 2023

@AlexanderYastrebov AlexanderYastrebov marked this pull request as draft July 24, 2023 10:25
@AlexanderYastrebov
Copy link
Member Author

Closing in favour of #2480

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

Successfully merging this pull request may close these issues.

4 participants