tommy44458 / mqtt-vue-hook

Mqtt-Vue-hook is a TypeScript library that makes it easy to connect to an MQTT broker (supports v5) and manages callback functions for various topics.
https://www.npmjs.com/package/mqtt-vue-hook
MIT License
24 stars 3 forks source link

wss #10

Closed Sunny0218 closed 1 year ago

Sunny0218 commented 1 year ago

Does it not support the wss protocol?

tommy44458 commented 1 year ago

Hi @Sunny0218, Sure, you can refer to my other project: https://github.com/tommy44458/light-vue3-starter

In production env, it connects to a public broker by wss protocol.

Sunny0218 commented 1 year ago

@tommy44458 Thank you.I can connect my mqtt borker use wss. There is one more question I would like to ask you. In vue project, if I use app.use(mqttVueHook, CONFIG) to connect to mqtt broker, then is the whole vue instance project is a mqtt client, no matter I subscribe or publish any topic, it is based on the current vue instance which is a mqtt client? If I want different components to act as different mqtt clients, what can I do?

tommy44458 commented 1 year ago

@Sunny0218,

I'm sorry for not getting back to you sooner. I have released a new version, v1.2.19, which supports multiple MQTT clients within a single project. You can refer to the "Multi-Client" section in the README for more information.

Sunny0218 commented 1 year ago

@Sunny0218,

I'm sorry for not getting back to you sooner. I have released a new version, v1.2.19, which supports multiple MQTT clients within a single project. You can refer to the "Multi-Client" section in the README for more information.

thank you so much!