fiddler redirect https to localhost

ぃ、小莉子 提交于 2019-12-13 13:06:32

问题


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;

回答1:


Try using this approach:

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

Complete description of the issue is here.



来源:https://stackoverflow.com/questions/28547919/fiddler-redirect-https-to-localhost

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!