{"id":49438254,"url":"https://github.com/florextech/chaos-internet-simulator","last_synced_at":"2026-05-02T21:01:09.572Z","repository":{"id":354068053,"uuid":"1221261007","full_name":"florextech/chaos-Internet-simulator","owner":"florextech","description":"Break your network before your users do. Local chaos proxy + dashboard + CLI for testing unstable internet and APIs.","archived":false,"fork":false,"pushed_at":"2026-04-27T20:04:03.000Z","size":510,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-29T18:38:24.068Z","etag":null,"topics":["chaos-engineering","developer-tools","docker","fastify","open-source","proxy","react","typescript"],"latest_commit_sha":null,"homepage":"https://github.com/florextech/chaos-Internet-simulator","language":"TypeScript","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/florextech.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-26T00:52:39.000Z","updated_at":"2026-04-29T04:49:22.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/florextech/chaos-Internet-simulator","commit_stats":null,"previous_names":["florextech/chaos-internet-simulator"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/florextech/chaos-Internet-simulator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/florextech%2Fchaos-Internet-simulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/florextech%2Fchaos-Internet-simulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/florextech%2Fchaos-Internet-simulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/florextech%2Fchaos-Internet-simulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/florextech","download_url":"https://codeload.github.com/florextech/chaos-Internet-simulator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/florextech%2Fchaos-Internet-simulator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32473805,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: 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":["chaos-engineering","developer-tools","docker","fastify","open-source","proxy","react","typescript"],"created_at":"2026-04-29T18:30:42.180Z","updated_at":"2026-04-30T19:00:45.267Z","avatar_url":"https://github.com/florextech.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chaos Internet Simulator\n\n![Chaos Internet Simulator Logo](./assets/chaos-internet-simulator-logo.svg)\n\n**Break your network before your users do.**\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](./LICENSE)\n![CI](https://img.shields.io/github/actions/workflow/status/florextech/chaos-Internet-simulator/ci.yml?branch=main\u0026label=CI)\n[![npm CLI](https://img.shields.io/npm/v/@florexlabs/chaos-net?label=chaos-net%20cli)](https://www.npmjs.com/package/@florexlabs/chaos-net)\n[![npm UI](https://img.shields.io/npm/v/@florexlabs/ui?label=florexlabs%20ui)](https://www.npmjs.com/package/@florexlabs/ui)\n![Node.js](https://img.shields.io/badge/Node.js-20%2B-339933)\n![TypeScript](https://img.shields.io/badge/TypeScript-5.x-3178C6)\n![Docker](https://img.shields.io/badge/Docker-ready-2496ED)\n![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)\n\nChaos Internet Simulator is an open source local proxy + dashboard + CLI to simulate real-world bad internet and unstable APIs during development.\n\n## Why this project?\n\nMost teams test with perfect localhost network. Production is not perfect.\n\nChaos Internet Simulator helps teams reproduce realistic failure modes early, before users see them.\n\n## Who is this for?\n\n- frontend developers validating loading/error states\n- backend developers testing retries and idempotency\n- QA and SRE teams stress-testing app resilience\n- DX and platform teams creating reproducible failure drills\n\n## Examples of what you can test\n\n- slow navigation and high latency\n- random API 5xx errors\n- intermittent timeouts\n- unstable HTTPS tunnels (CONNECT drops/timeouts)\n- selective chaos by URL/path/domain\n- scenario-based progressive degradation\n\n### Dashboard Preview\n\n![Chaos Internet Simulator Dashboard](./assets/dashboard-preview.png)\n\n## Monorepo structure\n\n```text\nchaos-Internet-simulator/\n├── apps/\n│   ├── proxy/\n│   ├── dashboard/\n│   └── cli/\n├── packages/\n│   ├── core/\n│   └── presets/\n├── docs/\n├── examples/\n├── plugins/\n├── recordings/\n└── ...\n```\n\n## Installation\n\n```bash\npnpm install\n```\n\n## Quick demo\n\n```bash\npnpm dev\ncurl -x http://localhost:8080 https://jsonplaceholder.typicode.com/posts/1\n```\n\n## Local usage\n\n```bash\ncp .env.example .env\npnpm dev\n```\n\nOpen:\n\n- Dashboard: `http://localhost:3000`\n- Proxy: `http://localhost:8080`\n- Control API: `http://localhost:8081`\n\n## Docker usage\n\n```bash\ndocker compose up --build\n```\n\nPrebuilt release images (GHCR):\n\n- `ghcr.io/florextech/chaos-internet-simulator-proxy:latest`\n- `ghcr.io/florextech/chaos-internet-simulator-dashboard:latest`\n\nPublish automation:\n\n- GitHub Action: `.github/workflows/publish-docker.yml`\n- Runs on release publish and `workflow_dispatch`\n\n## CLI usage\n\n```bash\npnpm --filter @florexlabs/chaos-net build\npnpm --filter @florexlabs/chaos-net exec chaos-net status\npnpm --filter @florexlabs/chaos-net exec chaos-net start\npnpm --filter @florexlabs/chaos-net exec chaos-net profile unstable-api\npnpm --filter @florexlabs/chaos-net exec chaos-net logs\npnpm --filter @florexlabs/chaos-net exec chaos-net scenario bad-mobile-network\npnpm --filter @florexlabs/chaos-net exec chaos-net record start\npnpm --filter @florexlabs/chaos-net exec chaos-net record stop\npnpm --filter @florexlabs/chaos-net exec chaos-net replay sample.json\npnpm --filter @florexlabs/chaos-net exec chaos-net replay off\n```\n\nWithout cloning this repo:\n\n```bash\nnpm i -g @florexlabs/chaos-net\nchaos-net status\n```\n\n## cURL usage\n\n```bash\ncurl -x http://localhost:8080 https://jsonplaceholder.typicode.com/posts\nbash examples/curl_examples.sh\n```\n\n## Postman usage\n\nImport:\n\n- `examples/postman_collection.json`\n\nThen configure proxy host `localhost` port `8080`.\n\n## Axios / fetch usage\n\n- Axios sample: `examples/node-axios-example.ts`\n- fetch (undici) sample: `examples/node-fetch-example.ts`\n- Full workflow guide: `docs/developer-workflows.md`\n\n## HTTP_PROXY and HTTPS_PROXY\n\n```bash\nexport HTTP_PROXY=http://localhost:8080\nexport HTTPS_PROXY=http://localhost:8080\n```\n\n## chaos.config.json\n\nSupported fields:\n\n- `enabled`\n- `activeProfile`\n- `targetBaseUrl`\n- `proxyPort`\n- `controlApiPort`\n- `rules`\n- `customProfiles`\n\nExample:\n\n```json\n{\n  \"enabled\": true,\n  \"activeProfile\": \"slow-3g\",\n  \"targetBaseUrl\": \"https://jsonplaceholder.typicode.com\",\n  \"proxyPort\": 8080,\n  \"controlApiPort\": 8081,\n  \"rules\": [{ \"match\": \"/posts\", \"profile\": \"slow-3g\" }],\n  \"customProfiles\": {\n    \"my-bad-network\": {\n      \"delayMs\": 3500,\n      \"errorRatePercent\": 10,\n      \"timeoutRatePercent\": 5,\n      \"timeoutMs\": 12000\n    }\n  }\n}\n```\n\nPriority:\n\n1. env vars\n2. `chaos.config.json`\n3. defaults\n\n## Available profiles\n\n- `normal`\n- `slow-3g`\n- `airport-wifi`\n- `unstable-api`\n- `total-chaos`\n- `starbucks-wifi`\n- `colombia-4g`\n- `office-vpn`\n- `international-latency`\n- `road-trip-network`\n\n## Scenarios\n\n- `bad-mobile-network` (loop)\n- `api-degrading`\n\n## HTTPS support and limitations\n\n- HTTPS traffic is supported through CONNECT tunneling.\n- Chaos can apply delay, timeout, forced error, and connection drop before tunnel establishment.\n- MITM is intentionally not implemented in this phase.\n- Encrypted HTTPS payload is not inspected or rewritten.\n\n## Dashboard\n\nDashboard provides:\n\n- chaos on/off and active profile controls\n- target URL and per-route rule editor\n- custom profile editor\n- real-time logs\n- metrics overview cards\n- Playwright E2E tests for key flows (render, toggle, config updates)\n\n## UI Library (`@florexlabs/ui`)\n\nDashboard now uses `@florexlabs/ui` as the reusable UI base.\n\nUse it in any project without cloning:\n\n```bash\npnpm add @florexlabs/ui\n```\n\n```tsx\nimport '@florexlabs/ui/florex.css';\nimport { Button, Card, Input } from '@florexlabs/ui';\n```\n\nMigrated components:\n\n- `Button`\n- `Card`\n- `Badge`\n- `Input`\n- `Container`\n- `Section`\n- `Spinner`\n- `EmptyState`\n\nStill local (by design):\n\n- native select controls in profile/rules forms (simple keyboard-native behavior)\n- request log table structure and density styles (proxy-specific data layout)\n\nBasic usage example:\n\n```tsx\nimport { Badge, Button, Card, Input } from '@florexlabs/ui';\n```\n\n## Metrics\n\n`GET /metrics` exposes:\n\n- totalRequests\n- delayedRequests\n- erroredRequests\n- timedOutRequests\n- throttledRequests\n- droppedConnections\n- averageResponseTimeMs\n- activeProfile\n- activeScenario\n- chaosEnabled\n\n## Plugins\n\n- Local plugins loaded from `plugins/`\n- Hooks: `onRequest`, `onResponse`\n- Capabilities: `forceError`, `addDelay`, `skipChaos`, `setHeader`, `dropConnection`\n- Plugin failures are isolated and logged\n\nSee:\n\n- `docs/plugins.md`\n- `plugins/random-auth-failure.example.ts`\n\n## Record \u0026 Replay\n\nControl API:\n\n- `POST /record/start`\n- `POST /record/stop`\n- `POST /replay/start`\n- `POST /replay/stop`\n\nRecordings are JSON files under `recordings/`.\n\n## Control API\n\n- `GET /health`\n- `GET /state`\n- `POST /state/enabled`\n- `POST /state/profile`\n- `POST /state/rules`\n- `POST /state/target-base-url`\n- `GET /logs`\n- `GET /metrics`\n- `GET /profiles`\n- `POST /profiles/custom`\n- `GET /scenario`\n- `GET /scenarios`\n- `POST /scenario`\n- `POST /scenario/off`\n- `POST /record/start`\n- `POST /record/stop`\n- `POST /replay/start`\n- `POST /replay/stop`\n\n## Detailed docs\n\n- `docs/README.md`\n- `docs/proxy.md`\n- `docs/dashboard.md`\n- `docs/cli.md`\n- `docs/configuration.md`\n- `docs/developer-workflows.md`\n- `docs/plugins.md`\n- `docs/ui-system.md`\n\n## Scripts\n\n- `pnpm dev`\n- `pnpm build`\n- `pnpm test`\n- `pnpm lint`\n- `pnpm format`\n\n## Roadmap\n\nAlready done:\n\n- HTTPS basic support via CONNECT tunneling (without MITM)\n- temporal scenarios support (API, CLI, dashboard visibility)\n- local plugin system with request/response hooks\n- record and replay mode with JSON storage\n\nStill pending:\n\n- optional MITM HTTPS mode\n- richer scenario editor in dashboard\n- plugin marketplace ideas\n- HAR import/export helpers\n\n## Contributing\n\nSee `CONTRIBUTING.md`.\n\n## License\n\nMIT (`LICENSE`)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflorextech%2Fchaos-internet-simulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflorextech%2Fchaos-internet-simulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflorextech%2Fchaos-internet-simulator/lists"}