【问题标题】:Redirect windows process to new URL将 Windows 进程重定向到新 URL
【发布时间】:2010-10-28 23:27:42
【问题描述】:

如何重定向程序以连接到不同的 URL。

我看了这个帖子:Is it possible to redirect a url to another using a webproxy ( such as fiddler )

我在机器上安装了fidller,并将这段代码放在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); 

我需要这样做,以便我可以在测试 url 上测试我们的新服务器服务,并确保客户端软件仍然可以正常交互。

【问题讨论】:

    标签: url redirect url-interception


    【解决方案1】:

    我知道怎么做。 :) 我想阅读 Fiddler 文档会有所帮助。

    我加了

    if (oSession.HTTPMethodIs("CONNECT") && (oSession.PathAndQuery == "www.example.com:443")) { 
        oSession.PathAndQuery = "beta.example.com:443"; 
    }
    
    if (oSession.HostnameIs("www.example.com")) oSession.hostname = "beta.example.com";  
    

    OnBeforeRequest

    我在http://www.fiddler2.com/fiddler/dev/scriptsamples.asp找到了这个

    【讨论】:

      猜你喜欢
      • 2011-08-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-29
      • 1970-01-01
      • 2019-08-15
      • 2015-09-14
      相关资源
      最近更新 更多