Fiddler:创建自动响应规则以将所有呼叫映射到一台主机到另一台主机 [英] Fiddler: Creating an AutoResponse rule to map all calls to one host to another host

查看:34
本文介绍了Fiddler:创建自动响应规则以将所有呼叫映射到一台主机到另一台主机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

示例:我想创建一个自动响应规则,将所有调用映射到一台主机到另一台主机,但保留网址.例子

Example: I want to create one AutoResponse rule that will map all calls to one host to another host, but preserve the urls. Examples

http://hostname1/foo.html -> http://hostname2/foo.html

http://hostname1/js/script.js -> http://hostname2/js/script.js

在一个规则中.目前,我已经通过为我的项目调用的每个 URL 创建一个 N 自动响应规则来实现这一点,但我确信必须有一种方法可以使用正确的通配符来纠正一条规则.我看了http://www.fiddler2.com/Fiddler2/help/AutoResponder.asp,但我不知道该怎么做.通配符似乎都围绕匹配而不是动作.

in one rule. For now, I've accomplished this by creating aN AutoResponse rule for every URL my project calls, but I'm sure there must be a way to right one rule using the right wildcards. I looked at http://www.fiddler2.com/Fiddler2/help/AutoResponder.asp, but I couldn't see how to do it. The wild cards all seem to be around the matching and not the action.

完整上下文:我正在测试平台上进行开发,而 Visual Studio 很无聊,以至于它将所有请求发送到 http://localhost:24575 当我的项目实际在 http://localhost:56832 上运行时

Full context: I'm developing on a beta platform and Visual Studio is borked in such away that it is sending all the requests to http://localhost:24575 when my project is actually running on http://localhost:56832

推荐答案

要从一台主机映射到另一台主机,请不要使用 AutoResponder.而是点击工具 > 主机.

To map from one host to another, don't use AutoResponder. Instead, click Tools > Hosts.

或者,您可以单击规则 > 自定义规则,滚动到 OnBeforeRequest 并编写一些代码:

Alternatively, you can click Rules > Customize Rules, scroll to OnBeforeRequest and write a bit of code:

if (oSession.HostnameIs("localhost") && (oSession.port == 24575)) oSession.port = 56832;

这篇关于Fiddler:创建自动响应规则以将所有呼叫映射到一台主机到另一台主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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