Skip to content

Settings API ​

The Settings API provides endpoints for reading and updating NectoProxy's configuration. Settings control the proxy port, UI port, body size limits, timeouts, and more.

Endpoints Overview ​

MethodEndpointDescription
GET/api/settingsGet all settings
GET/api/settings/:keyGet a specific setting
PUT/api/settings/:keyUpdate a specific setting
PUT/api/settingsBulk update multiple settings
POST/api/settings/resetReset all settings to defaults

Get All Settings ​

GET /api/settings

Retrieve the complete settings object.

Example Request ​

bash
curl http://localhost:8889/api/settings

Response 200 OK ​

json
{
  "settings": {
    "proxy": {
      "port": 8888,
      "sslPort": 8889,
      "maxBodySize": 10485760,
      "timeout": 30000,
      "keepAlive": true
    },
    "ui": {
      "port": 8889,
      "autoOpen": true,
      "theme": "system",
      "fontSize": 14,
      "maxTrafficDisplay": 10000,
      "autoScroll": true
    },
    "storage": {
      "dataDir": "~/.nectoproxy",
      "maxDatabaseSize": 1073741824,
      "retentionDays": 30,
      "compressOldSessions": true
    },
    "certificates": {
      "caName": "NectoProxy CA",
      "caValidityDays": 3650,
      "certValidityDays": 365,
      "keySize": 2048
    }
  }
}

Get Specific Setting ​

GET /api/settings/:key

Retrieve the value of a single setting.

Path Parameters ​

ParameterTypeDescription
keystringSetting key (see available keys)

Example Request ​

bash
curl http://localhost:8889/api/settings/proxy

Response 200 OK ​

json
{
  "key": "proxy",
  "value": {
    "port": 8888,
    "sslPort": 8889,
    "maxBodySize": 10485760,
    "timeout": 30000,
    "keepAlive": true
  }
}

Update a Specific Setting ​

PUT /api/settings/:key

Update a specific setting value.

Path Parameters ​

ParameterTypeDescription
keystringSetting key to update

Request Body ​

json
{
  "value": {
    "port": 9090,
    "sslPort": 9091,
    "maxBodySize": 20971520,
    "timeout": 60000,
    "keepAlive": true
  }
}
FieldTypeRequiredDescription
valueanyYesThe new value for the setting

Example Request ​

bash
curl -X PUT http://localhost:8889/api/settings/ui \
  -H "Content-Type: application/json" \
  -d '{"value": {"port": 8889, "autoOpen": false, "theme": "dark", "fontSize": 14, "maxTrafficDisplay": 5000, "autoScroll": true}}'

Response 200 OK ​

json
{
  "key": "ui",
  "value": {
    "port": 8889,
    "autoOpen": false,
    "theme": "dark",
    "fontSize": 14,
    "maxTrafficDisplay": 5000,
    "autoScroll": true
  }
}

Error 400 Bad Request ​

json
{
  "error": "Value is required"
}

Bulk Update Settings ​

PUT /api/settings

Update multiple settings at once by providing a partial settings object.

Request Body ​

json
{
  "proxy": {
    "timeout": 60000
  },
  "ui": {
    "theme": "dark"
  }
}

Example Request ​

bash
curl -X PUT http://localhost:8889/api/settings \
  -H "Content-Type: application/json" \
  -d '{
    "proxy": {"timeout": 60000, "maxBodySize": 20971520},
    "ui": {"theme": "dark", "autoScroll": false}
  }'

Response 200 OK ​

Returns the complete updated settings object:

json
{
  "settings": {
    "proxy": {
      "port": 8888,
      "sslPort": 8889,
      "maxBodySize": 20971520,
      "timeout": 60000,
      "keepAlive": true
    },
    "ui": {
      "port": 8889,
      "autoOpen": true,
      "theme": "dark",
      "fontSize": 14,
      "maxTrafficDisplay": 10000,
      "autoScroll": false
    },
    "storage": { "..." },
    "certificates": { "..." }
  }
}

Reset Settings to Defaults ​

POST /api/settings/reset

Reset all settings to their default values.

Example Request ​

bash
curl -X POST http://localhost:8889/api/settings/reset

Response 200 OK ​

Returns the complete settings object with all default values applied:

json
{
  "settings": {
    "proxy": {
      "port": 8888,
      "sslPort": 8889,
      "maxBodySize": 10485760,
      "timeout": 30000,
      "keepAlive": true
    },
    "ui": {
      "port": 8889,
      "autoOpen": true,
      "theme": "system",
      "fontSize": 14,
      "maxTrafficDisplay": 10000,
      "autoScroll": true
    },
    "storage": {
      "dataDir": "~/.nectoproxy",
      "maxDatabaseSize": 1073741824,
      "retentionDays": 30,
      "compressOldSessions": true
    },
    "certificates": {
      "caName": "NectoProxy CA",
      "caValidityDays": 3650,
      "certValidityDays": 365,
      "keySize": 2048
    }
  }
}

Restart May Be Required

Some settings, such as proxy.port and ui.port, require a restart of NectoProxy to take effect. Changes to ui.theme, ui.fontSize, and other cosmetic settings apply immediately.


Setting Keys ​

Proxy Settings (proxy) ​

KeyTypeDefaultDescription
portnumber8888HTTP proxy listening port
sslPortnumber8889HTTPS/SSL proxy port
maxBodySizenumber10485760Maximum request/response body size in bytes (10 MB)
timeoutnumber30000Request timeout in milliseconds
keepAlivebooleantrueEnable HTTP keep-alive connections

UI Settings (ui) ​

KeyTypeDefaultDescription
portnumber8889Web UI and API server port
autoOpenbooleantrueAutomatically open browser when proxy starts
themestring"system"UI theme: "light", "dark", or "system"
fontSizenumber14UI font size in pixels
maxTrafficDisplaynumber10000Maximum number of traffic entries displayed in UI
autoScrollbooleantrueAuto-scroll traffic list to newest entries

Storage Settings (storage) ​

KeyTypeDefaultDescription
dataDirstring"~/.nectoproxy"Directory for data storage
maxDatabaseSizenumber1073741824Maximum database size in bytes (1 GB)
retentionDaysnumber30Number of days to retain old sessions
compressOldSessionsbooleantrueCompress inactive session data

Certificate Settings (certificates) ​

KeyTypeDefaultDescription
caNamestring"NectoProxy CA"CA certificate common name
caValidityDaysnumber3650CA certificate validity period in days (10 years)
certValidityDaysnumber365Domain certificate validity period in days
keySizenumber2048RSA key size in bits for generated certificates

Example: Configure for Large File Testing ​

Increase body size and timeout limits
bash
# Increase max body size to 100 MB and timeout to 2 minutes
curl -X PUT http://localhost:8889/api/settings \
  -H "Content-Type: application/json" \
  -d '{
    "proxy": {
      "maxBodySize": 104857600,
      "timeout": 120000
    }
  }'