JSON Configuration File

You can create a file named 'config.json' in the same folder as your MQTT Proxy scripts to automatically load configuration details from a file, instead of needing to use the command-line.

Parameters include…

NameDefaultMeaning
webport80The HTTP port (set to 443 if using SSL)
ardiserverlocalhostThe source ARDI server URL
topicardi/proxyThe MQTT topic to communicate under
remotesslcertThe SSL security certificate file
remotesslkeyThe SSL private key file
mqttserverlocalhostThe MQTT server URL
mqttport1883The MQTT server port number
mqttsecure0Set to 1 to use TLS/SSL security
mqttuserThe username for the MQTT server
mqttpassThe password for the MQTT server
mqttcertThe client certificate for the MQTT server

Example File

The file below is for a system that supports live data and uses a secure MQTT server that requires authentication.

{
   "ardiserver": "https://myardiserver/",
   "webport": 443,
   "remotesslcert": "cert.pem",
   "remotesslkey": "key.pem",
   "mqttserver": "my.shared.server",
   "mqttuser": "myusername",
   "mqttpass": "mypassword",
   "mqttsecure": 1,
   "topic": "ardi/serverx/proxy"
}

Note that this would require you to have created a security certificate.