Skip to content

Latest commit

 

History

History
38 lines (25 loc) · 893 Bytes

notes.md

File metadata and controls

38 lines (25 loc) · 893 Bytes

processing frame by http2 server

server -> readRawBytes -> convertToFrameStructs -> processFrame()

Refer

frame processing

rawBytes to Frame

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
}

Frame of interest

  • MetaHeadersFrame: Contains actualy http data such as; httpHeaders

different frame parsers

Map of Parsers