Reputation: 4668
The example given on the aws website uses Paho and I'm trying to adapt it using mqtt.js as it seems to have much better adoption. Since I'm working on Angular 6+ I decided to go for ngx-mqtt which doesn't have great adoption but uses mqtt.js under the hood and seems to provide a convenient observable interface.
1) Is this possible at all or am I going in a dead end? Should I stick with Paho?
2) here's what the devtools network looks like:
Here's my configuration:
import { MqttModule } from 'ngx-mqtt';
MqttModule.forRoot({ connectOnCreate: false })
...
this.mqttService.connect({ protocol: 'wss', hostname: 'foo', path: '/bar', port: 80 });
this.mqttService.observe('baz');
related read:
Upvotes: 0
Views: 1648
Reputation: 359
ngx-mqtt works well. I used ngx-mqtt without problems (i'm lying) in my angular 8 app. For the basic config this link may help you: it's my question and i started from this medium guide. (I'm still stuck because i'm over https and mqtt require tls in order to work and i didn't resolved my issue yet).
Regarding the network inspector, of course you are not seeing a 'get' request: those methods are http related and have nothing to do with the socket protocol.
Upvotes: 3