Background and motivation
When troubleshooting a live application, it would be nice to be able to open Fiddler and (nearly) immediately see HTTP requests flowing through it.
Unfortunately, the current HTTPClient / HttpClient.DefaultProxy is not suitable for this. The first time it is called it seems to capture the value from SystemProxyInfo.ConstructSystemProxy and cache is for the life of the application. This results in needing reflection or other methods in order to retrieve the actualy current system proxy information.
API Proposal
namespaceSystem.Net.Http;publicstaticclassWebProxy{publicstaticIWebProxyGetSystemProxy();}API Usage
// Fancy the valuevarProxy=System.Net.Http.WebProxy.GetSystemProxy();
Alternative Designs
Leave as-is.
Risks
I assume that SystemProxyInfo.ConstructSystemProxy is a heavy method. Users of this function might call it too frequently.
Background and motivation
When troubleshooting a live application, it would be nice to be able to open Fiddler and (nearly) immediately see HTTP requests flowing through it.
Unfortunately, the current HTTPClient / HttpClient.DefaultProxy is not suitable for this. The first time it is called it seems to capture the value from SystemProxyInfo.ConstructSystemProxy and cache is for the life of the application. This results in needing reflection or other methods in order to retrieve the actualy current system proxy information.
API Proposal
API Usage
Alternative Designs
Leave as-is.
Risks
I assume that SystemProxyInfo.ConstructSystemProxy is a heavy method. Users of this function might call it too frequently.