ngx-mqtt
ngx-mqtt copied to clipboard
connectOnCreate options
- [ ] I have searched for similar issues in this repository, but couldn't find one.
- [x ] I have read the README and have a basic understanding how angular works.
I'm submitting a...
- [ ] Regression (a behavior that used to work and stopped working in a new release)
- [x ] Bug report
- [ ] Feature request
Current behavior
I'm in Angular 14, and passing in an empty connection object into my Angular Service code. And I was wondering why the browser was constantly checking for a ws
connection on my local port '80'.
Turns out that in ngx-mqtt.js, on the _handlOnReconnect event on line 92, it appears to be retrying - event though this.options.connectOnCreate is undefined
.
Then in mqtt.js,
it tries to keep a ws conn inside function createBrowserWebSock(client, opts)
Expected behavior
If the connection object is empty in the application's app.module - {} - then it should NOT attempt to connect to the local websocket.
Minimal working example of the problem with instructions
What is the motivation / use case for changing the behavior?
Environment
ngx-mqtt version: 9.0.5
- Broker HiveMQ
Others: