H2c - Go Packages
- Why Go Why Go
- Case Studies
- Use Cases
- Security
- Learn
- Docs Docs
- Effective Go
- Go User Manual
- Standard library
- Release Notes
- Packages
- Community Community
- Recorded Talks
- Meetups
- Conferences
- Go blog
- Go project
- Get connected
Details
-
Valid go.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
-
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
-
Tagged version
Modules with tagged versions give importers more predictable builds.
-
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
cs.opensource.google/go/x/netLinks
-
Report a Vulnerability
-
Open Source Insights
- Documentation
- Overview
- Index
- Examples
- NewHandler
- Constants
- Variables
- Functions
- NewHandler(h, s)
- Types
- Source Files
Documentation ¶
Overview ¶
Package h2c implements the unencrypted "h2c" form of HTTP/2.
The h2c protocol is the non-TLS version of HTTP/2 which is not available from net/http or golang.org/x/net/http2.
Index ¶
- func NewHandler(h http.Handler, s *http2.Server) http.Handler
Examples ¶
- NewHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
func NewHandler(h http.Handler, s *http2.Server) http.HandlerNewHandler returns an http.Handler that wraps h, intercepting any h2c traffic. If a request is an h2c connection, it's hijacked and redirected to s.ServeConn. Otherwise the returned Handler just forwards requests to h. This works because h2c is designed to be parseable as valid HTTP/1, but ignored by any HTTP server that does not handle h2c. Therefore we leverage the HTTP/1 compatible parts of the Go http library to parse and recognize h2c requests. Once a request is recognized as h2c, we hijack the connection and convert it to an HTTP/2 connection which is understandable to s.ServeConn. (s.ServeConn understands HTTP/2 except for the h2c part of it.)
The first request on an h2c connection is read entirely into memory before the Handler is called. To limit the memory consumed by this request, wrap the result of NewHandler in an http.MaxBytesHandler.
Example ¶ handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { fmt.Fprint(w, "Hello world") }) h2s := &http2.Server{ // ... } h1s := &http.Server{ Addr: ":8080", Handler: NewHandler(handler, h2s), } log.Fatal(h1s.ListenAndServe())Types ¶
This section is empty.
Source Files ¶
View all Source files - h2c.go
Jump to
Keyboard shortcuts
| ? | : This menu |
| / | : Search site |
| f or F | : Jump to |
| y or Y | : Canonical URL |
Từ khóa » H2c
-
H2C Securities Inc
-
Healthcare Investment Banking | H2C Securities Inc. | Biographies
-
H2C Securities Inc. (H2C) - LinkedIn
-
H2C - Webike Thailand
-
H2C Smuggling Named Top Web Hacking Technique Of 2020
-
H2C - SteadyMoto
-
H2C Smuggling In The Wild - Assetnote
-
H2C: Automotive
-
H2c Smuggling: A New 'Devastating' Kind Of HTTP Request
-
H2C Ligand Summary Page - RCSB PDB
-
List Of Products By Manufacturer H2C - Motorkit
-
Fstab/h2c: Http2client - GitHub
-
H2C | Phụ Tùng Xe Máy Webike