File tree 1 file changed +9
-7
lines changed
1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 6
6
//
7
7
// The h2c protocol is the non-TLS version of HTTP/2 which is not available from
8
8
// 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.
9
17
package h2c
10
18
11
19
import (
@@ -38,13 +46,7 @@ func init() {
38
46
}
39
47
40
48
// 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.
48
50
type h2cHandler struct {
49
51
Handler http.Handler
50
52
s * http2.Server
You can’t perform that action at this time.
0 commit comments