Fiddler with asp.net core and configure asp.net core as a reverse proxy.

Scenario 1: Configure Fiddler to capture outgoing requests from asp.net core process

You need to define a custom Class Implementing IWebProxy as below

aspnetproxy3.png

Now, you need configure HttpClientHandler in your controller with the custom class (MyHttpProxy) to feed the fiddler proxy settings

aspnetproxy1.png

Now, the outgoing call from the methods should be proxied through fiddler.

Scenario2: Configure asp.net core process to act as a reverse proxy

We can run asp.net core acting as a reverse proxy, wherein it can route the requests to another backend web server. In the below diagram the client talks to asp.net core over port 443 and asp.net core routes the request to backend service over port 80

aspnetproxy2.png

There are only couple of things you need to do:

Install Nuget Package “Microsoft.AspNetCore.Proxy”

Configure the proxy middleware in the startup.cs

ProxyOptions proxyOptions = new ProxyOptions(); proxyOptions.Host = "yourbackendserver"; proxyOptions.Scheme = "http"; proxyOptions.Port = "80";

app.RunProxy(proxyOptions);

you can download the complete sample here https://github.com/fasigpt/fiddlerwithaspnetcore