https://github.com/h0x0er/http2util
A golang module to parse rawBytes of http2 frames
https://github.com/h0x0er/http2util
frames golang http2 http2util
Last synced: 4 months ago
JSON representation
A golang module to parse rawBytes of http2 frames
- Host: GitHub
- URL: https://github.com/h0x0er/http2util
- Owner: h0x0er
- License: mit
- Created: 2023-11-07T08:45:46.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-13T06:39:54.000Z (over 1 year ago)
- Last Synced: 2025-02-06T12:14:54.717Z (5 months ago)
- Topics: frames, golang, http2, http2util
- Language: Go
- Homepage:
- Size: 20.5 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
## http2util: Dump rawBytes of http2 frames to string, http.Request or http.Response
## Usage
```go
import "github.com/h0x0er/http2util"rawBytes := []byte{} // http2 frame bytes
// Creating frame out of rawBytes
frame, _ := http2util.BytesToFrame(rawBytes)// Usage 1: Dumping frame to string
frameString, _ := http2util.Dump(frame)
fmt.Println(frameString)// Usage2: Creating http.Request from frame
req, _ = http2util.FrameToHTTPRequest(frame)// Usage3: Creating http.Response from frame
res, _ = http2util.FrameToHTTPReponse(frame)```
## Limitations
- `FrameToHTTPRequest()` & `FrameToHTTPResponse()`: Currently doesn't supports extraction of `httpBody` from frame.
## Contribution
Feel free to open an issue or send a PR for improvement