gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 15:37:38 25 4
gpt4 key购买 nike

我最近开始使用 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com