How to detect if a network proxy is being used?

2716
1
Jump to solution
07-29-2015 03:23 PM
Highlighted
Regular Contributor

Does anyone know how I might detect if a network is using a proxy or not? In our old .NET Windows Mobile application we used the following code to get through any proxy in place, and am wondering how to replicate this in QT.

WebClient web = new WebClient();

if (web.Proxy != null)

{

web.Proxy.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;

}

Regards,

-Paul

Tags (2)
Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Regular Contributor

In case anyone else is wondering, the following seems to work, when placed in the Component.onCompleted section of the app:

if(AppFramework.network.proxy.type !== 2) { ArcGISRuntime.setupProxy(AppFramework.network.proxy.url) }

type 2 is "no proxy".

This seems to work so far in our scenario, am open to comments or further suggestions...

View solution in original post

Reply
0 Kudos
1 Reply
Highlighted
Regular Contributor

In case anyone else is wondering, the following seems to work, when placed in the Component.onCompleted section of the app:

if(AppFramework.network.proxy.type !== 2) { ArcGISRuntime.setupProxy(AppFramework.network.proxy.url) }

type 2 is "no proxy".

This seems to work so far in our scenario, am open to comments or further suggestions...

View solution in original post

Reply
0 Kudos