提琴手将https重定向到本地主机 [英] fiddler redirect https to localhost

查看:97
本文介绍了提琴手将https重定向到本地主机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个iPhone应用程序,该应用程序连接到Azure中的HTTPS服务.我想将iPhone调用通过Fiddler重定向到 http://localhost:19703 ,在此我会在本地计算机上运行相同的服务以进行调试.我可以使用以下Fiddler脚本将HTTPS服务重定向到另一个HTTPS服务.但是,如果我使用相同的脚本重定向到localhost:19703,它将无法正常工作.有什么想法吗?

I have an iPhone app that connects to an HTTPS service in Azure. I want to redirect the iPhone calls via Fiddler to http://localhost:19703 where I am running the same service on my local machine for debugging purposes. I am able to redirect the HTTPS service to another HTTPS service using the following Fiddler script. However, if I use the same script to redirect to localhost:19703, it does not work. Any ideas?

   if (oSession.HTTPMethodIs("CONNECT") && (oSession.PathAndQuery ==  "XXXX.azurewebsites.net:443")) 
    {  
        oSession["OriginalHostname"] = oSession.hostname;
        oSession.PathAndQuery =  "YYYY.azurewebsites.net:443";  
    }

    // If it's an HTTPS tunnel, override the certificate

    if (oSession.HTTPMethodIs("CONNECT") && (null != oSession["OriginalHostname"]))
    {
        oSession["x-overrideCertCN"] = oSession["OriginalHostname"];
        oSession["X-IgnoreCertCNMismatch"] = "Server's hostname may not match what we're expecting...";
    }
    oSession.bypassGateway = true;

推荐答案

尝试使用此方法:

static function OnBeforeRequest(oSession:Fiddler.Session) {
    ...
    if (oSession.HostnameIs("YYYY.azurewebsites.net")) {
        oSession.host = "127.0.0.1:19703";
    }
    ...
}

完整的问题描述是此处.

这篇关于提琴手将https重定向到本地主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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