icanos / ng2-mqtt

Angular2 port of the mqttws31 library
17 stars 24 forks source link

Secure connection #5

Closed AinoL closed 7 years ago

AinoL commented 7 years ago

Hello!

I wonder if it's at all possible to create a wss connection instead of ws by using this library? I've been trying to modify the js file to use a secure connection but I keep getting 403 errors.

Thanks!

icanos commented 7 years ago

I think you could do it by providing a connectOptions object to the connect function setting useSSL to true.

Example: this._client.connect({ onSuccess: this.onConnected.bind(this); useSSL: true; });

Reference: http://www.eclipse.org/paho/files/jsdoc/symbols/Paho.MQTT.Client.html

Hope it helps!

AinoL commented 7 years ago

Actually that and tweaks to my client params did the trick. Closing issue.