# Configure Proxy Settings

The proxy settings of the **365 business Proxy Application Client** are stored in the `config.json` file.

<Callout type="info" title="Info">
The `config.json` file is a JSON configuration file. Changes must therefore be made using valid JSON syntax.
</Callout>

---

## Open the Configuration File

Open the `config.json` file in the following directory with a text editor, for example Notepad:

```text
%ProgramData%\365 business development GmbH\365 business Proxy Application\Client
```

Start the text editor in **administrator mode**, otherwise the file may not be saved.

<Callout type="tip" title="Good to know">
On Windows, you can search for "Notepad", right-click it, select **Run as administrator**, and then open the file via **File > Open**.
</Callout>

---

## Configuration File Structure

The file already contains existing client settings, such as the WebSocket address, tenant ID, client ID, and client name.

A simplified `config.json` can look like this:

```json
{
  "WebSocketURL": "https://proxyapplication.365businessapi.com/Jobs",
  "TenantId": "00000000-0000-0000-0000-000000000000",
  "ClientId": "00000000-0000-0000-0000-000000000000",
  "ClientName": "Proxy Client Name",
  "IsEnabled": true,
  "Proxy": {
    "Enabled": false,
    "Url": null,
    "BypassProxyOnLocal": false,
    "UserCredentials": null
  }
}
```

<Callout type="danger" title="Important">
Do not replace the entire file content. Only adjust the `Proxy` section, or add it if it does not exist yet.
</Callout>

---

## Add or Adjust the Proxy Configuration

Search the file for the `Proxy` section.

If the section already exists, adjust the values inside `Proxy`.

If the section does not exist yet, add it inside the outer JSON object.

<Callout type="danger" title="Important">
If you add the `Proxy` section at the end of the existing JSON file, the previous entry must end with a comma.
</Callout>

Example:

```json
{
  "WebSocketURL": "https://proxyapplication.365businessapi.com/Jobs",
  "TenantId": "00000000-0000-0000-0000-000000000000",
  "ClientId": "00000000-0000-0000-0000-000000000000",
  "ClientName": "Proxy Client Name",
  "IsEnabled": true,
  "Proxy": {
    "Enabled": true,
    "Url": "http://hostname:port",
    "BypassProxyOnLocal": false,
    "UserCredentials": null
  }
}
```

---

## Proxy Without User Authentication

Use this variant if your proxy server does not require user authentication.

```json
{
  "WebSocketURL": "https://proxyapplication.365businessapi.com/Jobs",
  "TenantId": "00000000-0000-0000-0000-000000000000",
  "ClientId": "00000000-0000-0000-0000-000000000000",
  "ClientName": "Proxy Client Name",
  "IsEnabled": true,
  "Proxy": {
    "Enabled": true,
    "Url": "http://hostname:port",
    "BypassProxyOnLocal": false,
    "UserCredentials": null
  }
}
```

---

## Proxy With User Authentication

Use this variant if your proxy server requires user authentication.

```json
{
  "WebSocketURL": "https://proxyapplication.365businessapi.com/Jobs",
  "TenantId": "00000000-0000-0000-0000-000000000000",
  "ClientId": "00000000-0000-0000-0000-000000000000",
  "ClientName": "Proxy Client Name",
  "IsEnabled": true,
  "Proxy": {
    "Enabled": true,
    "Url": "http://hostname:port",
    "BypassProxyOnLocal": false,
    "UserCredentials": {
      "Username": "user.name",
      "Password": "p@ssword"
    }
  }
}
```

<Callout type="danger" title="Important">
Make sure the `Proxy` section exists only once in the file. If a `Proxy` section already exists, modify the existing section instead of adding a second one.
</Callout>

---

## Adjust Values

Adjust the following values for your environment:

| Setting | Description |
|---|---|
| `Enabled` | Enables or disables proxy usage. Use `true` to enable the proxy. |
| `Url` | Address of the proxy server, for example <code className="url-nowrap">http://proxy.example.com:8080</code>. |
| `BypassProxyOnLocal` | Specifies whether local addresses should bypass the proxy. |
| `UserCredentials` | Credentials for the proxy server. Use `null` if no authentication is required. |
| `Username` | User name for proxy authentication. |
| `Password` | Password for proxy authentication. |

<Callout type="info" title="Info">
The proxy URL must include the protocol and port, for example <code className="url-nowrap">http://proxy.example.com:8080</code>.
</Callout>

---

## Example: Disable the Proxy

To disable proxy usage, set `Enabled` to `false`.

```json
{
  "WebSocketURL": "https://proxyapplication.365businessapi.com/Jobs",
  "TenantId": "00000000-0000-0000-0000-000000000000",
  "ClientId": "00000000-0000-0000-0000-000000000000",
  "ClientName": "Proxy Client Name",
  "IsEnabled": true,
  "Proxy": {
    "Enabled": false,
    "Url": null,
    "BypassProxyOnLocal": false,
    "UserCredentials": null
  }
}
```

---

## Save the File and Restart the Service

Save the `config.json` file.

Then restart the Windows service:

```text
365 business Proxy Application Client
```

The changed proxy settings are applied only after the service has been restarted.

<Callout type="tip" title="Good to know">
You can restart the service via Windows Services. Open `services.msc`, find the **365 business Proxy Application Client** service, and select **Restart**.
</Callout>
