模拟数据包之间的延迟与小提琴手的HTTP POST请求 [英] Simulate latency between packets for HTTP POST requests with Fiddler

查看:323
本文介绍了模拟数据包之间的延迟与小提琴手的HTTP POST请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以看到我怎么可以编写脚本在提琴手的整体延迟使用ScriptEditor,使用这样的:

I can see how I can script an overall latency in Fiddler using the ScriptEditor, using something like this:

if (oSession.HostnameIs("www.testsite.co.uk")) {
    oSession["request-trickle-delay"] = "500";
}

然而,我需要更具体并指定包含头请求的第一个数据包之间的延迟,以及包含身体的二次包

However, I need to be more specific and specify a delay between the first packet of the request which contains the header, and the secondary packets that contain the body.

我试图模拟一个与我们的Web客户端的0.3%出现,从他们那里我们接收到请求头,但缺少请求主体的一个问题。有没有一致的用户代理。各种浏览器和操作系统似乎受到了影响。所有POST请求从XMLHtt prequests(XHR)发起。它们看起来像这一点,并且包含JSON机构:

I am trying to simulate a problem that is occurring with 0.3% of our web clients, from whom we are receiving a request header, but a missing request body. There is no consistent user agent. Various browsers and operating systems appear to be affected. All POST requests are originating from XMLHttpRequests (XHR). They look like this, and contain JSON bodies:

POST http://www.sitename.co.uk/folder/controller/list HTTP/1.1
Host: www.sitename.co.uk
Connection: keep-alive
Content-Length: 245
Accept: application/json, text/javascript, */*; q=0.01
Origin: http://www.sitename.co.uk
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17
Content-Type: application/json
Referer: http://www.sitename.co.uk/folder/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-GB,en;q=0.8,en-US;q=0.6
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: **removed**

{"bb":{"tl":{"lat":51.590527931951975,"lng":-0.636399852539089},"tr":{"lat":51.590527931951975,"lng":0.42652739355466096},"bl":{"lat":51.29736817638294,"lng":-0.636399852539089},"br":{"lat":51.29736817638294,"lng":0.42652739355466096}},"b":true}

我已经检查了MTU大小设置防火墙级别,并设置为1500,我相信会好的。

I have checked the MTU size set at firewall level and it is set to 1500, which I believe to be fine.

该网站的服务器是在负载平衡器和运行Windows Server 2008 R2 64位上的IIS 7.5。网站上ASP.NET MVC3运行。

The web servers are behind a load balancer and are running IIS 7.5 on Windows Server 2008 R2 64-bit. Website is running on ASP.NET MVC3.

推荐答案

这是值得一提的是,头可能是多个TCP / IP数据包,并没有什么要求,人体在不同的数据包比头。但我假设你正在使用的术语包松散

提琴手v2.4.2.6有一个请求 - 车身延时会话标志,这将使你要找的延迟;将其设置为如 5000 5秒延时的身体。 (v2.4.2.6目前处于alpha: https://fiddler2.com/dl/fiddler2alphasetup.exe

Fiddler v2.4.2.6 has a Request-Body-Delay session flag that would enable the delay you're looking for; set it to e.g. 5000 to delay the body by 5 seconds. (v2.4.2.6 is currently in alpha: https://fiddler2.com/dl/fiddler2alphasetup.exe)

FWIW,这是可能的头被送往但POST身体不是。可以在IE浏览器发生,如果您已经安装了越野车的插件(请参阅Why在IE 10拒绝通过jQuery $就发送POST数据的例子)。

FWIW, it's possible that the headers were sent but the POST body wasn't. That can happen in IE if you have a buggy plugin installed (see Why is IE 10 Refusing to send POST data via jQuery $.ajax for an example).

也可能出现此问题。举例来说,如果你正在试图做的方法OnBeforeUnload一个帖子,标题可能会被发送,但发出的POST前体的过程中丧生。

This problem can also occur if the connection is dropped. For instance, if you are attempting to do a POST in the OnBeforeUnload method, the headers may be sent but the process killed before the POST body is emitted.

这篇关于模拟数据包之间的延迟与小提琴手的HTTP POST请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆