Force Flow
Force Flow

Reputation: 724

Bandwidth limiter for localhost for web development

I have XAMPP running on localhost on Windows 7. I was trying to find a way to simulate the bandwidth of dialup and 3G connections.

Is there a current solution which works on a localhost and Windows 7 and is reasonably straight-forward to enable and disable as necessary?

Upvotes: 2

Views: 3379

Answers (3)

Prince Odame
Prince Odame

Reputation: 544

You can use @sitespeed.io/throttle - an npm package.

Example:

# simulate slow 3g connection on localhost
npx @sitespeed.io/throttle 3gslow --localhost

# throttle localhost with roundtrip time of 200ms
npx @sitespeed.io/throttle --rtt 200 --localhost
    
# later when you are done,... stop throttling
npx @sitespeed.io/throttle --stop --localhost

Note that throttle requires sudo, and will prompt for user login.

Alternatively, throttle can be used programmatically in NodeJS. Example (copied from docs):

const throttle = require('@sitespeed.io/throttle');
// Returns a promise
const options = {up: 360, down: 780, rtt: 200};
await throttle.start(options);
// Do your thing and then stop
await throttle.stop();

See the documentation for more options.

Upvotes: 0

majapahit
majapahit

Reputation: 71

The easiest way to use Chrome developer tools. On network tab, there is feature to throttle bandwidth in different use cases.

Upvotes: 2

Quentin
Quentin

Reputation: 943686

Chales proxy includes a bandwidth throttle.

Upvotes: 1

Related Questions