is there anyway to throttle connection speed (band

2019-04-20 15:44发布

问题:

I was wondering it there was a way to throttle inbound connection speed using some extension / addon for any modern browser?

I would like to slow the speed down to something like 20kbs just to see how things load, as well for other testing.

Does anyone know to accomplish this using any of the modern browsers?

回答1:

Edit (2017-04-09): The major browsers have this functionality built-in by now:

  • Firefox documentation
  • Chrome documentation

Original response follows for reference, it might still be useful in some scenarios.

I used NetLimiter at some point - it works with all applications and can assign individual bandwidth limits for them.

Note that while this might be a good approximation for modem users (if you ever find some), it doesn't quite show you how a user somewhere in China perceives your website. The problem there isn't so much bandwidth but rather long and largely varying ping times (up to occasional packet loss). Unfortunately, I'm not aware of applications that are able to simulate random network delays and packet loss.



回答2:

Another alternative is Charles Proxy - it lets you simulate slow network connections. This approach is browser independent, just alter the browsers network configuration to use Charles as its web proxy.



回答3:

As of late 2014, chrome now has this built directly into the developer tools.

https://developer.chrome.com/devtools/docs/device-mode#network-conditions



回答4:

For Firefox, you could use FirefoxThrottle. If you need to test different browsers, I'd go for a throttling proxy instead.



回答5:

You can do an online test with http://www.webpagetest.org under test settings / connection



回答6:

Finally Firefox also added Network Throttling control in their Responsive Design Mode in DevTools. Available in v.52.x https://developer.mozilla.org/en-US/docs/Tools/Responsive_Design_Mode#Network_throttling



回答7:

You could configure your browser to use a tunneling proxy that limits the speed. For example, running in Node.js the following server

//Node.js 5.12.0
var net = require('net'),
    tg = new (require('stream-throttle').ThrottleGroup)({rate: 20*1024});
net.createServer((s) => {
    var d = net.connect({ port: *, host: '**' });
    s.on('error', () => {}).once('close', () => d.end());
    d.on('error', () => {}).once('close', () => s.end());
    s.pipe(d).pipe(tg.throttle()).pipe(s);
}).on('error', (err) => {throw err}).listen(8124);

,where * and ** are the port and the ip address, respectively, of a proxy server, and configuring your browser to connect to 127.0.0.1, port 8124, reduces the speed to 20 KB/s. The proxy can be any remote or local proxy server (e.g., Squid, Privoxy or one from npm) that supports the same protocol as the browser.



回答8:

Apart from the built-in functionality of two major browsers- Chrome and Firefox described above, you can use Fiddler which gives support for Microsoft Edge, Internet Explorer, Chrome and Firefox at the same time which is a bonus!

And for safari, the free download option Network Link Conditioner is the best and easier choice to throttle. You can find the detailed answer for safari here.