NetworkProxy QML Type

Provides a network layer proxy. More...

Import Statement: import ArcGIS.AppFramework 1.0
Inherits:

AppFrameworkObject

Properties

Detailed Description

The NetworkProxy component provides the method for configuring network layer proxy support to the Network component. The proxy support is designed to be as transparent as possible, meaning that existing network-enabled applications that you have written can be easily made to support network proxies through the use of this component.

This code sample demonstrates how to set up a proxy for your app using NetworkProxy, so that debug logs can be captured with tools such as Charles Proxy or Fiddler.

Item {
    property url proxyUrl: proxyUrlTextField.text
    property url testUrl: testUrlTextField.text

    Column {
        anchors.left: parent.left
        anchors.right: parent.right
        anchors.top: parent.top
        anchors.margins: 10

        spacing: 10

        TextField {
                    id: proxyUrlTextField
                    width: parent.width
                    placeholderText: qsTr("Proxy URL")
                    text: AppFramework.network.proxy.url
        }

        TextField {
                    id: testUrlTextField
                    width: parent.width
                    placeholderText: qsTr("Test URL")
                    text: "http://appstudio.arcgis.com/api/debug?f=pjson"
                }

                Button {
                        text: qsTr("Send")
                        onClicked: send()
                }

                Text {
                        text: qsTr("Proxy Type: %1").arg(AppFramework.network.proxy.type)
                }

                Text {
                        text: qsTr("Proxy Url: %1").arg(AppFramework.network.proxy.url)
                }

                Text {
                        text: qsTr("Network Request Ready State: %1").arg(networkRequest.readyState)
                }

                TextArea {
                        width: parent.width
                        text: networkRequest.responseText
                        readOnly: true
                }

                NetworkRequest {
                        id: networkRequest
                        url: testUrl
                }
        }

        function send() {
                AppFramework.network.proxy.url = proxyUrl;
                AppFramework.network.proxy.type = (proxyUrl != '') ? NetworkProxy.HttpProxy : NetworkProxy.DefaultProxy;
                networkRequest.send();
        }
}

Enumerations

ProxyType enumeration

This enum describes the type of proxy to be provided.

NameValue
NetworkProxy.DefaultProxy0
NetworkProxy.Socks5Proxy1
NetworkProxy.NoProxy2
NetworkProxy.HttpProxy3
NetworkProxy.HttpCachingProxy4
NetworkProxy.FtpCachingProxy5

Property Documentation

type : ProxyType

Returns the proxy type for this instance.


url : url

Returns the proxy's URL.


useSystemProxy : bool


Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.