Skip to content
Snippets Groups Projects
Commit 06d75336 authored by Viktor Vorobev's avatar Viktor Vorobev Committed by Sandro Weber
Browse files

Merged in NRRPLT-8931-wss (pull request #50)

[NRRPLT-8931] Add ws/wss parameter to config

* [NRRPLT-8931] Add ws/wss parameter to config

* [NRRPLT-8931] Add ws/wss parameter to config


Approved-by: Sandro Weber
parent d39ba070
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,6 @@ class App extends React.Component {
componentDidMount() {
this.mqttClientService = MqttClientService.instance;
//MqttClientService.instance.connect('ws://' + window.location.hostname + ':1884');
}
render() {
......
......@@ -12,6 +12,7 @@
"mqtt": {
"url": "localhost",
"port": "9000",
"websocket": "ws",
"topics": {
"base": "nrp_simulation",
"errors": "runtime_error",
......
......@@ -28,8 +28,9 @@ export default class MqttClientService extends EventEmitter {
this.subTokensMap = new Map();
// Since it's a singleton, shoud the url be defined here?
this.mqttBrokerUrl = 'ws://' + frontendConfig.mqtt.url + ':' + frontendConfig.mqtt.port;
// Since it's a- singleton, shoud the url be defined here?
const websocket_s = frontendConfig.mqtt.websocket ? frontendConfig.mqtt.websocket : 'ws';
this.mqttBrokerUrl = websocket_s + '://' + frontendConfig.mqtt.url + ':' + frontendConfig.mqtt.port;
this.connect();
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment