Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Protocol Pubsub

Rick Mak edited this page Apr 7, 2017 · 1 revision

Pubsub

Pubsub is currently mount at /pubsub

Overview

Authentication is done by X-Ourd-API-Key or X-Ourd-Access-Token Header. Backed by Websocket RFC 6455. Ourd pubsub only provide the service of keeping coeection and boardcast events.

Ourd will not inject attributes like sender id. Only inject timestamp on boardcast message on

Format

Subscribe to a chanel

{
    "action": "sub",
    "channel": "royuen"
}

Unsubscribe to a chanel

{
    "action": "unsub",
    "channel": "royuen"
}

Publish a message to a channel

{
    "action": "pub",
    "channel": "royuen",
    "data": {
        "any": "thing"
    }
}

Subscribed client will received

{
    "channel": "royuen",
    "data": {
        "any": "thing"
    },
    "timestamp": 1439972917
}
Clone this wiki locally