Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// display
console.info("BridgeServient configured with");
console.dir(this.config);
// http server for local control and monitoring
let httpServer = (typeof this.config.http.port === "number") ? new HttpServer(this.config.http.port) : new HttpServer();
this.addServer(httpServer);
// remote proxy bridges
if (this.config.fujitsu) this.addServer(new FujitsuServer(this.config.fujitsu.remote));
if (this.config.oracle) this.addServer(new OracleServer(this.config.oracle.store, password));
// clients for consuming
this.addClientFactory(new FileClientFactory());
this.addClientFactory(new HttpClientFactory(this.config.http));
this.addClientFactory(new HttpsClientFactory(this.config.http));
this.addClientFactory(new CoapClientFactory());
this.addClientFactory(new CoapsClientFactory());
}
var coapServer = (typeof this.config.coap.port === "number") ? new CoapServer(this.config.coap.port) : new CoapServer();
this.addServer(coapServer);
}
if (this.config.mqtt !== undefined) {
let mqttBrokerServer = new MqttBrokerServer(this.config.mqtt.broker,
(typeof this.config.mqtt.username === "string") ? this.config.mqtt.username : undefined,
(typeof this.config.mqtt.password === "string") ? this.config.mqtt.password : undefined,
(typeof this.config.mqtt.clientId === "string") ? this.config.mqtt.clientId : undefined,
(typeof this.config.mqtt.protocolVersion === "number") ? this.config.mqtt.protocolVersion : undefined);
this.addServer(mqttBrokerServer);
}
}
this.addClientFactory(new FileClientFactory());
this.addClientFactory(new HttpClientFactory(this.config.http));
this.addClientFactory(new HttpsClientFactory(this.config.http));
this.addClientFactory(new CoapClientFactory(coapServer));
this.addClientFactory(new CoapsClientFactory());
this.addClientFactory(new MqttClientFactory());
}