server -> readRawBytes -> convertToFrameStructs -> processFrame()
Refer
- https://cs.opensource.google/go/x/net/+/master:http2/server.go
- method: serverConn.processFrame()
func BytesToHTTP2Frame(b []byte) (http2.Frame, error) {
rd := bytes.NewReader(b)
buf := bufio.NewReader(rd)
fr := http2.NewFramer(nil, buf)
fr.ReadMetaHeaders = hpack.NewDecoder(0, nil)
f, err := fr.ReadFrame()
if err != nil {
return nil, err
}
return f, nil
}
- MetaHeadersFrame: Contains actualy http data such as; httpHeaders