{"id":37122339,"url":"https://github.com/code-lion-com/go-unhar","last_synced_at":"2026-01-14T14:08:33.972Z","repository":{"id":216235601,"uuid":"740660278","full_name":"code-lion-com/go-unhar","owner":"code-lion-com","description":"Zero dependency golang module and CLI to handle HTTP Archive (HAR) files.","archived":false,"fork":false,"pushed_at":"2024-01-09T05:12:41.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-01-09T06:25:32.989Z","etag":null,"topics":["cli","golang","har","http-archive","network-analysis","web-crawling"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/code-lion-com.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-08T19:57:35.000Z","updated_at":"2024-06-19T12:14:20.717Z","dependencies_parsed_at":null,"dependency_job_id":"7de1d8a1-24df-44ad-9122-38c377d7f32a","html_url":"https://github.com/code-lion-com/go-unhar","commit_stats":null,"previous_names":["code-lion-com/go-unhar"],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/code-lion-com/go-unhar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-lion-com%2Fgo-unhar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-lion-com%2Fgo-unhar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-lion-com%2Fgo-unhar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-lion-com%2Fgo-unhar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/code-lion-com","download_url":"https://codeload.github.com/code-lion-com/go-unhar/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-lion-com%2Fgo-unhar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28422408,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T13:30:50.153Z","status":"ssl_error","status_checked_at":"2026-01-14T13:29:08.907Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","golang","har","http-archive","network-analysis","web-crawling"],"created_at":"2026-01-14T14:08:33.246Z","updated_at":"2026-01-14T14:08:33.965Z","avatar_url":"https://github.com/code-lion-com.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-unhar\nZero dependency golang module and CLI to handle [HTTP Archive (HAR)](https://w3c.github.io/web-performance/specs/HAR/Overview.html) files.\n\n**go-unhar can be used as:**\n1. A lightweight go module to parse HAR files.\n2. A standalone CLI tool to extract (think unzip) all resources (images, webpages, api answers) from a given HAR file.\n\n## go-unhar as a module\n### Install\n```bash\ngo get github.com/code-lion-com/go-unhar\n```\n### Load from file\nLoad HAR file to [`goUnhar.Har`](https://github.com/code-lion-com/go-unhar/blob/main/types.go) struct.\n```go\n// Load HAR from file\nhar := \u0026goUnhar.Har{}\nhar.Open(\"myFile.har\")\n```\n\n### Examples\n#### Display HAR tool name and version\n```go\nfmt.Printf(\n    \"HTTP Archive (HAR) version: %s\\nCreator: %s (%s)\\n\",\n    har.Log.Version, har.Log.Creator.Name, har.Log.Creator.Version,\n)\n//  HTTP Archive (HAR) version: \n//  Creator: WebInspector (537.36)\n```\n\n#### Overview all Entries\n\n```go\nfor _, entry := range har.Log.Entries {\n    status := entry.Response.Status\n    method := entry.Request.Method\n    url := entry.Request.URL\n    time := float64(entry.Time)\n    time = math.Round(time)\n    mimetype := entry.Response.Content.MimeType\n    ctype := mimetype[strings.LastIndex(mimetype, \"/\")+1:]\n    fmt.Printf(\"%d %s %dms %s %s\\n\", status, method, int(time), ctype, url)\n}\n// [...]\n// 200 GET 174ms javascript https://test.com/script.js\n// 200 GET 86ms svg+xml https://test.com/logo.svg\n// [...]\n```\n\n#### Display Cookies Sent to Server by Entry\n```go\nfor _, entry := range har.Log.Entries {\n    if len(entry.Request.Cookies) \u003e 0 {\n        fmt.Printf(\"\\n🍪 %d found %s\\n\", len(entry.Request.Cookies), entry.Request.URL)\n    }\n    cookies := entry.Request.Cookies\n    for nCookie, cookie := range cookies {\n        fmt.Printf(\"  🍪 #%d %v\\n\", nCookie+1, goUnhar.NVP{Name: cookie.Name, Value: cookie.Value})\n    }\n}\n// 🍪 3 found https://test.com/api/me\n//   🍪 #1 {SESSIONID 123456789}\n//   🍪 #2 {lang v=2\u0026lang=en-us}\n//   🍪 #3 {bcookie \"v=1\u002600000000-0000-0000-0000-00000000\"}\n//\n// 🍪 17 found https://ads.com/tracker\n//   🍪 #1 {uid 123456789}\n//   🍪 #2 {lang en-us}\n//   [...]\n```\n\n## UnHAR as a standalone CLI\n\n```bash\n# Add the cli tool to your gopath\ngo get github.com/code-lion-com/go-unhar/cmd/unhar\n\ncd ~/Desktop  # working dir\nunhar www.example.com.har  # extract to working dir\nls ~/Desktop/www.example.com  # list working dir\n# ~/Desktop/www.example.com\n# - index.html\n# - about.html\n# -- api\n#    |-- users/me\n# -- static\n#    |-- me.png\n#    |-- style.css\n```\n\n## Credits and similar projects\n- https://github.com/mrichman/hargo\n  Hargo parses HAR files, can convert to curl format, and serve as a load test driver.\n- https://github.com/arp242/har\n  Read HAR (\"HTTP Archive format\") archives\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-lion-com%2Fgo-unhar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcode-lion-com%2Fgo-unhar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-lion-com%2Fgo-unhar/lists"}