-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
16 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,32 @@ | ||
## Parsehttp2frame: Convert rawBytes of http2Frames to string representation | ||
|
||
|
||
## http2util: Dump rawBytes of http2 frames to string, http.Request or http.Response | ||
|
||
## Usage | ||
|
||
```go | ||
import "github.com/h0x0er/parsehttp2frame" | ||
import "github.com/h0x0er/http2util" | ||
|
||
rawBytes := []byte{} // http2 frame bytes | ||
|
||
frame, _ := parsehttp2frame.BytesToHTTP2Frame() | ||
frameString, _ := parsehttp2frame.Frame2String(frame) | ||
// 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) | ||
|
||
## Use-cases | ||
// Usage3: Creating http.Response from frame | ||
res, _ = http2util.FrameToHTTPReponse(frame) | ||
|
||
[] HeadersFrame To HttpRequest | ||
``` | ||
|
||
[] HeadersFrame to HttpResponse | ||
## 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 |