[英]How to get topic of mqtt client in websocket server
I am trying to get topic of mqtt client, i searched in google, i couldn't find right one. 我正在尝试获取mqtt客户端的主题,我在Google中进行了搜索,找不到合适的主题。
for example, from mqtt client, publish one message,consider server topic is 'topicOfServer' and client topic is 'topicOfClient'. 例如,从mqtt客户端发布一条消息,请考虑服务器主题为“ topicOfServer”,而客户端主题为“ topicOfClient”。
client.publish('topicOfServer','hi server'); client.publish('topicOfServer','hi server');
server will get 'hi server' message. 服务器将收到“ hi server”消息。 but how do server knows that message came from which client ex: 'topicOfClient' 但是服务器如何知道该消息来自哪个客户端,例如:'topicOfClient'
You seam to be confusing a couple of things here 您可能会在这里混淆两件事
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.