Skip to content

Commit

Permalink
Merge pull request #6 from h0x0er/readme
Browse files Browse the repository at this point in the history
Readme
  • Loading branch information
h0x0er authored Nov 13, 2023
2 parents c4f4ef3 + 415f762 commit af4dbe1
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## 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

0 comments on commit af4dbe1

Please sign in to comment.