Skip to content

Commit

Permalink
added readme
Browse files Browse the repository at this point in the history
  • Loading branch information
h0x0er committed Nov 13, 2023
1 parent a8c8c0a commit 415f762
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions README.md
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

0 comments on commit 415f762

Please sign in to comment.