Reverse Proxy Setup for HTTPS when Fiddler and WebServer both are runing on two different machines

603 views
Skip to first unread message

Ankit Peshwaria

unread,
Aug 11, 2016, 12:51:07 PM8/11/16
to Fiddler
Hello Eric, 

I am trying to setup reverse proxy and the current reverse proxy setup is attached as ".png" file  

Via reverse proxy from mobile device I want to access the websever (https) which is running on cloud. The Fiddler Web Debugger (v4.6.2.32002) is running on my machine (Window 10 Professional 32 bit).
Both the Mobile device (IPhone6Plus IOS 9.3.3) and machine running fiddler:8888 are connected to same wifi. 

I understand to do a reverse proxy, both fiddler and the webserver should be running on same machine. Is this true? This is because the current setup (See attachment) is not working. Will you be able to help me to setup a reverse proxy?

Regards
Ankit H Peshwaria 
ReverseProxySetup.png
Message has been deleted

Eric Lawrence

unread,
Aug 12, 2016, 1:56:19 PM8/12/16
to Fiddler
Much of the Fiddler documentation is written with the idea that Fiddler is acting as a reverse proxy for the local machine, but Fiddler can easily reverse proxy using any server as the backend.

The most immediate problem in your screenshot is that you've got code that says "host.toLowerCase() == "pcFiddler:8888" which is never going to match anything because "F" is capitalized. Furthermore, it looks like you're setting up a secure listener with a hostname of "webserver" listening on port 443, so you'll want to match those:

Use something like

   if (oSession.port == 443 && oSession.HostnameIs("webserver")) { 
   // ....
   }

Ankit Peshwaria

unread,
Aug 13, 2016, 3:56:20 AM8/13/16
to Fiddler
Thank you Eric!

With below changes it worked for me !!!. 

Change 1: Fiddler root certificate was already installed on my mobile, but still I removed and reinstalled again. 
Change 2: on pcFiddler, to make sure 443 port is not in use, stopped IIS on pcFiddler, and then using netstat make sure port 443 is not in use.  
Change 3: using fiddler QuickExec texbox, I ran command "!listen 443 pcfiddler"
Change 4: modified the fiddler script 
static function OnBeforeRequest(oSession: Session) { 
    if(oSession.HostnameIs("pcFiddler") && oSession.port == "443") {
oSession.host = "webserver.com";
oSession.oRequest.headers.UriScheme = "https";
    }
}

... it worked for me!

Now I am trying with port 444 and at the same time IIS to work with port 443. Let you know my finding.
Reply all
Reply to author
Forward
0 new messages