How to detect if a network proxy is being used?

3044
1
Jump to solution
07-29-2015 03:23 PM
by Anonymous User
Not applicable

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)
0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable

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

0 Kudos
1 Reply
by Anonymous User
Not applicable

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...

0 Kudos