将 Windows 进程重定向到新 URL
如何重定向程序以连接到不同的 URL。
我看了这篇文章: 是否可以使用网络代理(例如 fiddler)将 url 重定向到另一个
我在计算机上安装了 fiddler 并将此代码放入 onBeforeResponse 方法中的自定义规则中
oSession.utilDecodeResponse();
var oBody =System.Text.Encoding.UTF8.GetString(oSession.responseBodyBytes);
// Replace all instances of the DIV tag with an empty string
var oRegEx = "myoldurl.com";
oBody = oBody.replace(oRegEx, "testingurl.com");
// Set the response body to the div-less string
oSession.utilSetResponseBody(oBody);
我需要这样做,所以我可以在测试网址测试我们的新服务器服务,并确保客户端软件仍然可以正常交互。
How do I redirect a program to connect to a different URL.
I looked at this post: Is it possible to redirect a url to another using a webproxy ( such as fiddler )
I installed fidller on the machine and put this code in the custom rules in the onBeforeResponse method
oSession.utilDecodeResponse();
var oBody =System.Text.Encoding.UTF8.GetString(oSession.responseBodyBytes);
// Replace all instances of the DIV tag with an empty string
var oRegEx = "myoldurl.com";
oBody = oBody.replace(oRegEx, "testingurl.com");
// Set the response body to the div-less string
oSession.utilSetResponseBody(oBody);
I need to do this so I can test our new server service at a testing url and make sure the client software still interacts appropriately.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我知道怎么做了。 :) 我想阅读 Fiddler 文档会有所帮助。
我添加
到
OnBeforeRequest
我在 http://www 找到了这个.fiddler2.com/fiddler/dev/scriptsamples.asp
I found out how to do it. :) I guess it helps to read the Fiddler Documentation.
I added
to the
OnBeforeRequest
I found this at http://www.fiddler2.com/fiddler/dev/scriptsamples.asp