1

我在 Windows 7 的 localhost 上运行 XAMPP。我试图找到一种方法来模拟拨号和 3G 连接的带宽。

当前是否有适用于 localhost 和 Windows 7 的解决方案,并且可以根据需要直接启用和禁用?

4

3 回答 3

2

使用 Chrome 开发者工具的最简单方法。在网络选项卡上,具有在不同用例中限制带宽的功能。

于 2016-02-26T15:45:41.903 回答
1

Chales 代理包括带宽限制

于 2012-09-21T20:12:00.947 回答
0

您可以使用@sitespeed.io/throttle - 一个 npm 包。

例子:

# 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

注意throttle需要sudo,并且会提示用户登录。

或者,throttle可以在 NodeJS 中以编程方式使用。示例(从文档复制):

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();

有关更多选项,请参阅文档

于 2021-06-30T16:25:54.060 回答