Running Fiddler as an HTTPS HTTP Reverse Proxy

I have a service running on my machine. This service is published on HTTPS, and running it on HTTP seems a bit complicated. Some remote machine is making calls to my machine over HTTP (and this is not under my control). I want to run some non-performance tests with my service, and it seems like the easiest way is to use an HTTP reverse HTTPS proxy. Fiddler works great with the HTTP protocol HTTP and HTTPS for HTTPS, but I can't get it to work for my business. So what I need:

+----------------+ +--------------------------------+ | Remote machine | -------> | My machine | | | HTTP | Fiddler -------> My machine | | | | HTTPS service | +----------------+ +--------------------------------+ 

Can I achieve this with Fiddler?

+2
source share
1 answer

Of course, Fiddler can convert incoming requests from HTTP to HTTPS.

The easiest way is to add something inside OnBeforeRequest, for example:

 if (oSession.HostnameIs("myhost") && (oSession.oRequest.pipeClient.LocalPort == 80)) { oSession.fullUrl = "https://" + oSession.url; } 

This assumes, of course, that Fiddler has been configured to run on port 80, the default port for HTTP. You can run it on any port that you like (for example, if port 80 is already in use), but you will need to change the port in the URL that the client requests, and if you can do this, you can probably change the client to use the https URL to get started.

+3
source

Source: https://habr.com/ru/post/1202549/


All Articles