Skip to content

pagpeter/charly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

charly

Go library for parsing Charles Proxy .chlz session files.

Install

go get github.com/peter/charly

Usage

session, err := charly.OpenFile("capture.chlz")
if err != nil {
    log.Fatal(err)
}

for _, txn := range session.Transactions {
    fmt.Printf("%s %s%s → %d\n",
        txn.Meta.Method,
        txn.Meta.Host,
        *txn.Meta.Path,
        txn.Meta.Response.Status,
    )
    // txn.ResponseBody has the raw bytes
}

CLI

Convert .chlz to HAR:

go run ./cmd/chlz2har input.chlz > output.har

.chlz format

A .chlz file is a ZIP archive. Each HTTP transaction is stored as a set of flat files:

0-meta.json          # request/response metadata (always present)
0-req.dat            # request body (optional, extension matches content type)
0-res.html           # response body (optional)
1-meta.json
1-res.js
...

Body file extensions: .html, .js, .json, .txt, .dat (form data), .bin (binary).

The meta.json contains method, URL, headers, status, timing, TLS details, and connection info. HTTP/2 requests use pseudo-headers (:method, :path, etc.) instead of a first line. CONNECT tunnels have "tunnel": true and null timing fields.

About

Golang parser for .chlz files

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages