加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

调试 – 使用Fiddler调试Windows Phone 7模拟器

发布时间:2020-12-14 02:26:01 所属栏目:Windows 来源:网络整理
导读:我最近开始使用 Windows Phone 7的更新测试版工具,并遇到了一个有趣的问题.似乎在Fiddler运行时,任何Http请求都会通过模拟器开始返回null结果并创建一个“未找到”Web异常.使用WebClient.DownloadStringAsync()可以很容易地重现这一点.如果我没记错的话,旧版
我最近开始使用 Windows Phone 7的更新测试版工具,并遇到了一个有趣的问题.似乎在Fiddler运行时,任何Http请求都会通过模拟器开始返回null结果并创建一个“未找到”Web异常.使用WebClient.DownloadStringAsync()可以很容易地重现这一点.如果我没记错的话,旧版本的模拟器确实可以与Fiddler一起使用.有没有人幸运让两人一起工作?如果不可能,我会对任何其他可以帮助调试来自WP7模拟器的Web请求的工具开放.

解决方法

看起来有一个 blog post that describes getting fiddler working with Win Phone 7通过一些自定义规则来设置 Fiddler as a Reverse Proxy.

这里有一些来自fiddler网站的指示,但博客文章似乎更清晰一点(抱歉古怪的格式,块报价不合作):

Option #1: Configure Fiddler as a
Reverse-Proxy Fiddler can be
configured so that any traffic sent to
07002 is automatically
sent to a different port on the same
machine. To set this configuration:

Start REGEDIT Create a new DWORD named
ReverseProxyForPort inside
HKCUSOFTWAREMicrosoftFiddler

Set the DWORD to the local port you’d like
to re-route inbound traffic to
(generally port 80 for a standard HTTP
server) Restart Fiddler Navigate your
browser to 07002

Option #2: Write a FiddlerScript rule
Alternatively,you can write a rule
that does the same thing.

Say you’re running a website on port
80 of a machine named WEBSERVER.
You’re connecting to the website using
Internet Explorer Mobile Edition on a
Windows SmartPhone device for which
you cannot configure the web proxy.
You want to capture the traffic from
the phone and the server’s response.

Start Fiddler on the WEBSERVER machine,running on the default port of 8888. Click Tools | Fiddler Options,and ensure the “Allow remote clients to connect” checkbox is checked. Restart if needed. Choose Rules | Customize Rules. Inside the OnBeforeRequest handler,add a new line of code: if (oSession.host.toLowerCase() == “webserver:8888”) oSession.host = “webserver:80”; On the SmartPhone,navigate to 07004 Requests from the SmartPhone will appear in Fiddler. The requests are forwarded from port 8888 to port 80 where the webserver is running. The responses are sent back through Fiddler to the SmartPhone,which has no idea that the content originally came from port 80.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读