开发者

is there anyway to throttle connection speed (bandwidth) using modern browsers (chrome, ff, ie, safari) for testing?

I was wondering it there was a way to throttl开发者_运维知识库e 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?


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.


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

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


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.


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.


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


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


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜