public void AutoTamperRequestBefore(Session oSession) { if (model.Enabled) { // if (m_SimulateModem) { // // Delay sends by 300ms per KB uploaded. // oSession["request-trickle-delay"] = "30"; // // Delay receives by 150ms per KB downloaded. // oSession["response-trickle-delay"] = "150"; //} int requestDelay = SpeedConvert.covert(model.RequestDelaySpeed); int reponseDelay = SpeedConvert.covert(model.ReponseDelaySpeed); oSession["request-trickle-delay"] = Convert.ToString(requestDelay); oSession["response-trickle-delay"] = Convert.ToString(reponseDelay); } else { oSession["request-trickle-delay"] = null; oSession["response-trickle-delay"] = null; } // oSession.oRequest["User-Agent"] = sUserAgent; }
private void updateUI(SuperProxy.SpeedLimt4Fiddler.Model model) { this.textBox1.Text = Convert.ToString(model.RequestDelaySpeed); this.textBox2.Text = Convert.ToString(model.ReponseDelaySpeed); trackBar1.Value = Convert.ToInt32(model.RequestDelaySpeed); trackBar2.Value = Convert.ToInt32(model.ReponseDelaySpeed); int requestDelay = SpeedConvert.covert(model.RequestDelaySpeed); int reponseDelay = SpeedConvert.covert(model.ReponseDelaySpeed); this.label5.Text = "Current Speed:" + "request-" + this.textBox1.Text + "kbps " + "requestDelay - " + requestDelay + "ms " + "response - " + this.textBox2.Text + "kbps " + "responseDelay - " + reponseDelay + "ms "; button1.Enabled = model.Enabled; button2.Enabled = model.Enabled; button3.Enabled = model.Enabled; button4.Enabled = model.Enabled; trackBar2.Enabled = model.Enabled; trackBar1.Enabled = model.Enabled; trackBar2.Enabled = model.Enabled; textBox1.Enabled = model.Enabled; textBox2.Enabled = model.Enabled; }