背景说明

经常在工作当中需要测试手机 APP 的弱网环境,弱网的模拟可以使用 Fiddler 实现

1.准备工作

2.设置步骤

3.模拟随机弱网

static function randInt(min, max) {

return Math.round(Math.random()*(max-min)+min);

}

if (m_SimulateModem) {

// Delay sends by 300ms per KB uploaded.

oSession["request-trickle-delay"] = ""+randInt(1,2000);

// Delay receives by 150ms per KB downloaded.

oSession["response-trickle-delay"] = ""+randInt(1,2000);

}



↙↙↙阅读原文可查看相关链接,并与作者交流