Skip to content

Commit d3d2e98

Browse files
committed
http2/h2c: make the h2c connection docs available in godoc
1 parent 765c7e8 commit d3d2e98

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

Diff for: http2/h2c/h2c.go

+9-7
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
//
77
// The h2c protocol is the non-TLS version of HTTP/2 which is not available from
88
// net/http or golang.org/x/net/http2.
9+
//
10+
// There are two ways to begin a h2c connection
11+
// (RFC 7540 Section 3.2 and 3.4): (1) Starting with Prior Knowledge - this
12+
// works by starting an h2c connection with a string of bytes that is valid
13+
// HTTP/1, but unlikely to occur in practice and (2) Upgrading from HTTP/1 to
14+
// h2c - this works by using the HTTP/1 Upgrade header to request an upgrade to
15+
// h2c. When either of those situations occur we hijack the HTTP/1 connection,
16+
// convert it to an HTTP/2 connection and pass the net.Conn to http2.ServeConn.
917
package h2c
1018

1119
import (
@@ -38,13 +46,7 @@ func init() {
3846
}
3947

4048
// h2cHandler is a Handler which implements h2c by hijacking the HTTP/1 traffic
41-
// that should be h2c traffic. There are two ways to begin a h2c connection
42-
// (RFC 7540 Section 3.2 and 3.4): (1) Starting with Prior Knowledge - this
43-
// works by starting an h2c connection with a string of bytes that is valid
44-
// HTTP/1, but unlikely to occur in practice and (2) Upgrading from HTTP/1 to
45-
// h2c - this works by using the HTTP/1 Upgrade header to request an upgrade to
46-
// h2c. When either of those situations occur we hijack the HTTP/1 connection,
47-
// convert it to an HTTP/2 connection and pass the net.Conn to http2.ServeConn.
49+
// that should be h2c traffic.
4850
type h2cHandler struct {
4951
Handler http.Handler
5052
s *http2.Server

0 commit comments

Comments
 (0)