node-unifi icon indicating copy to clipboard operation
node-unifi copied to clipboard

[INFORMATION] Websockets

Open thib3113 opened this issue 4 years ago • 0 comments

Hello,

on unifiOS lot of websockets events come from : wss://unifi/api/ws/system with an object like :

interface IControllerEvent {
    type: string;
    [key: string]: unknown;
}

And it seems you just listen on : wss://unifi[/proxy/network]/wss/s/<siteName>/events . But on unifi ( non unifiOS ), some events are send on the "super" site wss://unifi[/proxy/network]/wss/s/super/events ( + events on the selected site ) . They are like the other SiteEvents so ( from what I saw ) :

export interface ISiteEvent {
    meta: {
        rc: string;
        message: string;
        product_line?: string;
    };
    data: Array<unknown>;
}

Some events like "admin login" are send on the super site websockets .

It can be interessting to add a way to listen on them

thib3113 avatar Jul 27 '21 17:07 thib3113