How to get, set or delete a proxy

Perform actions on the proxy of your SecureEdge device via the API.

❗️

SecureEdge API Authentication

Retrieving or modifying the proxy requires authentication. See How to authenticate to the API.

Introduction

Use the /api/v1/network/wan/proxy endpoint to retrieve, configure or remove the proxy of the SecureEdge.

The proxy settings are used system-wide, meaning for wired, wireless, and cellular connections. To configure the proxy in the local web interface instead, see Connect via a proxy server.

Retrieving the proxy

Use GET for retrieval:

curl --request GET \
     --url 'http://192.168.140.1:80/api/v1/network/wan/proxy' \
     --cookie 'session.jar'
{
    "address": "proxy.example.com",
    "port": 3128,
    "authentication": {
        "type": "none"
    }
}

If no proxy is configured, the response is 200 OK with the body null.

If the proxy uses authentication, the authentication object also contains the configured username and password.

{
    "address": "proxy.example.com",
    "port": 3128,
    "authentication": {
        "type": "basic",
        "username": "demo-user",
        "password": "demo-password"
    }
}

Configuring the proxy

Use POST to set the proxy. Setting a proxy replaces the existing one. A successful request returns 200 OK with an empty body.

curl --request POST \
     --url 'http://192.168.140.1:80/api/v1/network/wan/proxy' \
     --cookie 'session.jar' \
     --header 'Content-Type: application/json' \
     --data '
     {
         "address": "proxy.example.com",
         "port": 3128,
         "authentication": {
             "type": "none"
         }
     }'

To use a proxy that requires a username and password, set the authentication type to basic:

curl --request POST \
     --url 'http://192.168.140.1:80/api/v1/network/wan/proxy' \
     --cookie 'session.jar' \
     --header 'Content-Type: application/json' \
     --data '
     {
         "address": "proxy.example.com",
         "port": 3128,
         "authentication": {
             "type": "basic",
             "username": "<username>",
             "password": "<password>"
         }
     }'
FieldTypeDescription
addressstringIP address or hostname of the proxy.
portintPort of the proxy, from 1 to 65535.
authentication.typestringnone or basic.
authentication.usernamestringRequired when type is basic.
authentication.passwordstringRequired when type is basic.

Removing the proxy

Use DELETE to remove the proxy. The response is 200 OK with an empty body. Deleting when no proxy is configured also returns 200 OK.

curl --request DELETE \
     --url 'http://192.168.140.1:80/api/v1/network/wan/proxy' \
     --cookie 'session.jar'
🚧

Import the configuration into IXON Cloud

Changes made through the API are applied on the SecureEdge only. This includes setting, changing and removing the proxy. To avoid unwanted configuration changes later on, such as IXON Cloud applying the old proxy settings to the device again, import them into the IXON Cloud: go to Fleet Manager > Devices, click on your device name, open the sync options and select Import config from device. For more details, see How to import a configuration from an agent.

The proxy is used system-wide. If the SecureEdge cannot reach the configured proxy server, it cannot connect to the IXON Cloud.

Errors

Errors return a plain text body that describes the problem. The proxy configuration is not changed when a request fails.

StatusCause
400 Bad RequestThe body is empty or not valid JSON, or the port is 0.
415 Unsupported Media TypeThe Content-Type is not application/json.
422 Unprocessable EntityA field is missing, has the wrong type, or has an invalid value, for example a port above 65535, an empty address, or an unknown authentication type.

Did this page help you?