insomnia-plugin-slow-network
v1.0.3
Published
Simulates slow network conditions (3G, EDGE, 2G) to test APIs under poor connectivity. Use the X-Slow-Network header with chunk|delay format or template tags for ready-made presets.
Maintainers
Readme
slow-network
Insomnia plugin that simulates slow network conditions to test APIs under poor connectivity.
Installation in Insomnia
- Open Insomnia
- Go to Application → Preferences (or
Ctrl/Cmd + ,) - Click the Plugins tab
- Click Install Plugin
- Enter
insomnia-plugin-slow-networkand confirm - The plugin will be installed and appear in the list
How to Use in Insomnia
- Create or open a request
- In the Headers tab, add the
X-Slow-Networkheader - Set the value (see options below) and send the request
- The response will be delivered in chunks with delay, simulating a slow network
Configuration Options
Option 1: Template Tags (recommended)
- Add the header: use
{% slowNetworkHeader %}as header name, or typeX-Slow-Network - Set the value to a template tag:
{% slowNetwork3g %},{% slowNetworkEdge %}, etc. - Send the request
Available presets:
| Tag | Returns | Simulates |
| ------------------------------------- | -------------- | ----------- |
| {% slowNetworkHeader %} | X-Slow-Network | Header name |
| {% slowNetwork3g %} | 256 B, 200 ms | 3G |
| {% slowNetworkEdge %} | 128 B, 400 ms | EDGE |
| {% slowNetwork2g %} | 64 B, 700 ms | 2G |
| {% slowNetworkCustom chunk delay %} | custom | Custom |
Option 2: Manual value
Set the X-Slow-Network header to a value in the format chunk|delay:
X-Slow-Network: 256|200- chunk – Size of each chunk in bytes (e.g. 256)
- delay – Delay between chunks in milliseconds (e.g. 200)
Example
GET https://api.example.com/users
Headers:
X-Slow-Network: 128|400This simulates an EDGE-like connection: 128 bytes per chunk, 400 ms between chunks.
The Problem
APIs are usually tested on fast, stable connections. In production, many users face:
- Weak mobile signals (3G, EDGE, 2G)
- Congested networks
- Unstable connections
Without testing under these conditions, you may ship APIs that:
- Time out too early or too late
- Provide poor loading feedback
- Fail in ways you didn't anticipate
What This Plugin Solves
This plugin throttles request and response transfers by sending data in small chunks with configurable delays. You can:
- Test how your API behaves on slow networks
- Tune timeouts and retry logic
- Validate loading states and UX before production
How It Works
- Proxy – When a request includes the
X-Slow-Networkheader, the plugin starts a local proxy server. - Interception – The request is redirected to
localhost. The proxy receives it and forwards to the actual target. - Throttling – Both the request body and response body are sent in chunks of
Nbytes, withMms delay between each chunk. - Cleanup – After the response finishes, the proxy is stopped.
The format is chunk|delay (e.g. 256|200 = 256 bytes per chunk, 200 ms between chunks).
