{
  "$schema": "https://apidocs.iqrf.org/iqrf-gateway-daemon/com.iqrftech.self-desc/schema/jsonschema/1-0-0#",
  "self": {
    "vendor": "com.iqrftech.self-desc",
    "name": "schema__iqrf__WebsocketMessaging",
    "format": "jsonschema",
    "version": "1-0-0"
  },
  "type": "object",
  "required": [
    "component",
    "instance",
    "port",
    "acceptAsyncMsg",
    "acceptOnlyLocalhost",
    "transportMode",
    "tlsMode",
    "tlsPort",
    "cert",
    "privKey",
    "authTimeout",
    "maxClients"
  ],
  "additionalProperties": false,
  "properties": {
    "component": {
      "title": "Component name",
      "description": "Name of component.",
      "type": "string",
      "enum": [
        "iqrf::WebsocketMessaging"
      ]
    },
    "instance": {
      "title": "Instance name",
      "description": "Name of component instance.",
      "type": "string",
      "pattern": "^[a-zA-Z0-9-]+$",
      "default": "iqrf::WebsocketMessaging-1"
    },
    "port": {
      "title": "Listening port",
      "description": "Port on which websocket server listens for plain connections.",
      "type": "integer",
      "minimum": 1,
      "maximum": 65535,
      "example": 1338
    },
    "acceptAsyncMsg": {
      "title": "Send asynchronous messages",
      "description": "Accept and send asynchronous messages to clients.",
      "type": "boolean",
      "example": true
    },
    "acceptOnlyLocalhost": {
      "title": "Accept localhost only",
      "description": "Only accept localhost connections.",
      "type": "boolean",
      "example": true
    },
    "transportMode": {
      "title": "Transport mode",
      "description": "Mode of transport determines whether websocket server allows plain, tls or both connection types.",
      "type": "string",
      "enum": [
        "plain",
        "tls",
        "both"
      ],
      "example": "both"
    },
    "tlsMode": {
      "title": "TLS mode",
      "description": "TLS configuration according to mozilla SSL configuration profiles.",
      "type": "string",
      "enum": [
        "modern",
        "intermediate",
        "old"
      ],
      "example": "intermediate"
    },
    "tlsPort": {
      "title": "Listening port TLS",
      "type": "integer",
      "description": "Port on which websocket server listens for TLS connections.",
      "minimum": 1,
      "maximum": 65535,
      "example": 8338
    },
    "cert": {
      "title": "Certificate file",
      "description": "Path to server certificate file.",
      "type": "string",
      "example": "cert.pem"
    },
    "privKey": {
      "title": "Private key file",
      "description": "Path to server private key file.",
      "type": "string",
      "example": "privkey.pem"
    },
    "authTimeout": {
      "title": "Authentication timeout",
      "type": "integer",
      "description": "Time in seconds for clients to authenticate, failing to authenticate within the specified time results in connection termination.",
      "minimum": 10,
      "maximum": 60,
      "example": 30
    },
    "maxClients": {
      "title": "Maximum clients",
      "description": "Maximum number of concurrently connected clients.",
      "type": "integer",
      "minimum": 0,
      "example": 50
    }
  }
}
