Presence

Feng Lee edited this page Jun 2, 2015 · 3 revisions

Presence $SYS message

When client connected or disconnected, broker could publish presence messages to:

$SYS/brokers/${broker}/clients/${clientId}/connected

$SYS/brokers/${broker}/clients/${clientId}/disconnected

Payload examples:

Client mosqsub/80296-iMac.loca received PUBLISH (d0, q0, r0, m0, '$SYS/brokers/emqttd@127.0.0.1/clients/myclientid/connected', ... (105 bytes))
{"username":"undefined","ipaddress":"127.0.0.1","session":false,"protocol":4,"connack":0,"ts":1432864078}

Client mosqsub/80296-iMac.loca received PUBLISH (d0, q0, r0, m0, '$SYS/brokers/emqttd@127.0.0.1/clients/myclientid/disconnected', ... (35 bytes))
{"reason":"normal","ts":1432864078}

HTTP API(TODO...)

GET http://t.emqtt.io:8083/presences

RETURN 200 OK

[{clientid: "myclientid", ipaddress: "192.168.0.10", session: false, protocol: 3 | 4, connack: 0, ts: 1432864078},
 ......]

GET http://t.emqtt.io:8080/presences?clientid = clientid

RETURN 200 OK

{status: connected, ipaddress: "192.168.0.10", session: false, protoco: 3 | 4, connack: 0-5, ts: 19382783}
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.