0
votes

Is there any way to read the default proxy settings from within a UWP app (i.e., the values in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings)?

1
Won't the built-in HTTP client of UWP inherit the system proxy settings? - Seva Alekseyev
The app uses the built-in HTTP client for some purposes and the proxy settings work with that but a legacy library needs to have the proxy settings configured. So I need to be able to read them. - Carl
In general, they say it's possible but tricky: stackoverflow.com/questions/48899692/… However, see if you can retrieve the proxy settings from the HTTP client itself. - Seva Alekseyev
I saw that one and it looks like a pain for such a simple thing. Also looked at getting from HttpClient but saw no means to do saw. Looked at the ProxyConfiguration class, which is not available and is documented as "not supported on Windows Phone", which I assume means UWP. - Carl
@Carl WindowsPhone != UWP. Windows.Foundation.UniversalApiContract is UWP. so this IS UWP class that not supported by Windows Phones - ad1Dima

1 Answers

1
votes

This works:

using Windows.Networking.Connectivity;


Uri uri = new Uri("http://www.example.com");               
ProxyConfiguration xx = await NetworkInformation.GetProxyConfigurationAsync(uri);