Skip to content

How to send a message to particular client directly #781

Answered by robertsLando
timepp asked this question in Q&A
Discussion options

You must be logged in to vote

You could try to do it as follow:

var client = broker.clients['clientId']

var packet = {
qos: 1,
retain: true,
topic: 'my/topic',
payload: 'Hello world'
}

client.publish(packet, cb)

Replies: 6 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by robertsLando
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
4 participants
Converted from issue

This discussion was converted from issue #470 on October 14, 2022 09:51.