{"id":22001443,"url":"https://github.com/alshdavid/web-replay","last_synced_at":"2025-07-22T03:04:54.620Z","repository":{"id":225414836,"uuid":"600583704","full_name":"alshdavid/web-replay","owner":"alshdavid","description":"Replay a website using exported .har file","archived":false,"fork":false,"pushed_at":"2024-03-02T00:00:34.000Z","size":6287,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-23T05:27:11.543Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alshdavid.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}},"created_at":"2023-02-11T23:43:19.000Z","updated_at":"2024-12-23T10:26:51.000Z","dependencies_parsed_at":"2024-03-02T00:37:35.424Z","dependency_job_id":null,"html_url":"https://github.com/alshdavid/web-replay","commit_stats":null,"previous_names":["alshdavid/web-replay"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/alshdavid/web-replay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alshdavid%2Fweb-replay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alshdavid%2Fweb-replay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alshdavid%2Fweb-replay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alshdavid%2Fweb-replay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alshdavid","download_url":"https://codeload.github.com/alshdavid/web-replay/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alshdavid%2Fweb-replay/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266417072,"owners_count":23925300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-29T23:13:51.117Z","updated_at":"2025-07-22T03:04:54.599Z","avatar_url":"https://github.com/alshdavid.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Web Replay Tool (Replay .har)\n\n\u003cimg src=\"./.docs/1.png\" width=\"500\" \u003e\n\u003cimg src=\"./.docs/2.png\" width=\"500\" \u003e\n\u003cimg src=\"./.docs/3.png\" width=\"500\" \u003e\n\n## Introduction\n\nThis tool lets you replay an exported .har file from the DevTools network tab.\n\nThe tool spins up a local server and replays the requests stored in .har file on the local server.\n\nI wrote this tool for performance testing the client-side portion of a web app as it removed the latency introduced by the server and allowed me to test the client-side performance - but it can be used for website archiving, modifying content for demos and so on. \n\nThought it might be useful for someone.\n\n## Usage\n\nFirst, record your network activity from your live site and save the network tab to a `.har` file.\n\nOnly the requests in the network tab can be replayed so make sure you reload your page to capture the initial request.\n\nYou can click on \"preserve logs\" to store multiple pages.\n\nOnce you have a `.har` file exported from the network DevTools, pass it into the `web-replay` tool. \n\n```\nweb-reply -ssl-key ~/.ssl/localhost+1-key.pem -ssl-cert ~/.ssl/localhost+1.pem ./your.har\n```\n\nOpen Chrome on `https://localhost:3000/path/you/saved`.\n\nMake sure to use the complete path to the page your exported. \n\nFor example, if I export the har file from `https://github.com/alshdavid/web-replay` I will need to go to `https://localhost:3000/alshdavid/web-replay`.\n\nThis will replay the `.har` file exactly but it will not allow you to use the entire app.\n\n## SSL / HTTPS\n\nThis only serves HTTPS traffic as HTTP traffic behaves differently and can cause issues when replying sites saved from HTTPS sources.\n\nYou will need to supply a self-signed SSL certificate to the tool. \n\nI recommend using [mkcert](https://github.com/FiloSottile/mkcert) as it's a one line command that does everything for you.\n\n```bash\nmkdir ~/.ssl\ncd ~/.ssh\nmkcert -install\nmkcert localhost 127.0.0.1\nls\n\n\u003e localhost+1-key.pem  localhost+1.pem\n```\n\n## Patching Sites\n\nYou can patch responses, add latency, inject scripts and modify the responses.\n\nAdd patches to the `patches/enabled` folder next to the binary to run them.\n\nYou can see examples here: [patches/disabled](https://github.com/alshdavid/web-replay/tree/main/commands/web-replay/patches/disabled)\n\n## Installation\n\n### MacOS\n\n```bash\nrm -rf $HOME/.local/web-replay\nmkdir -p $HOME/.local/web-replay\ncurl -L --url https://github.com/alshdavid/web-replay/releases/latest/download/darwin-arm64.tar.gz | tar -xvzf - -C $HOME/.local/web-replay\nexport PATH=$HOME/.local/web-replay/bin:$PATH\n```\n\nAdd the following to your `~/.zshrc` and/or `~/.bashrc`\n\n```bash\nexport PATH=$HOME/.local/web-replay/bin:$PATH\n```\n\n### Linux\n\n```bash\nrm -rf $HOME/.local/web-replay\nmkdir -p $HOME/.local/web-replay\ncurl -L --url https://github.com/alshdavid/web-replay/releases/latest/download/linux-amd64.tar.gz | tar -xvzf - -C $HOME/.local/web-replay\nexport PATH=$HOME/.local/web-replay/bin:$PATH\n```\n\nAdd the following to your `~/.zshrc` and/or `~/.bashrc`\n\n```bash\nexport PATH=$HOME/.local/web-replay/bin:$PATH\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falshdavid%2Fweb-replay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falshdavid%2Fweb-replay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falshdavid%2Fweb-replay/lists"}