debugging - 使用 Fiddler 调试 Windows Phone 7 模拟器

标签 debugging windows-phone-7 fiddler

我最近开始使用 Windows Phone 7 的更新测试版工具,但遇到了一个有趣的问题。似乎随着 Fiddler 的运行,通过模拟器运行的任何 Http 请求都开始返回空结果并创建一个“未找到”的网络异常。这很容易用 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 http://127.0.0.1:8888 is automatically sent to a different port on the same machine. To set this configuration:

Start REGEDIT Create a new DWORD named ReverseProxyForPort inside HKCU\SOFTWARE\Microsoft\Fiddler

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 http://127.0.0.1:8888

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 http://webserver:8888 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.

关于debugging - 使用 Fiddler 调试 Windows Phone 7 模拟器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3305018/

相关文章:

debugging - 在 Windows 上响应 native 调试

c# - Linq to XML 从 twitter API 解析单个 "status"节点

windows-phone-7 - WP7 Microsoft Advertising AdControl消失并抛出异常

windows-phone-7 - 使用 ViewModelLocator 抓取其他 VM 以在另一个 Vm 中使用是否不好?

c# - 使用 fiddlercore 后关闭应用程序时代理设置未更改

javascript - 针对 Mobile Safari 内的文档调试外部 Javascript

仅在调试时捕获 C# 异常?

c++ - DirectX 11 : Shader not creating world view matrix

javascript - 防止浏览器控制从特定域加载 javascript

javascript - 在浏览器中替换 URL 路径,而不是在请求中