sequenceDiagram

    autonumber

    title: uibuilder security sequence

    participant client as client
    participant NR as Node-RED
    participant js as Custom Code

    client ->> NR: HTTPS GET endpoint & other services
    NR->>client: resources

    client->>NR: HTTPS Websocket connection request
    NR-->>client: 200: OK
    client->>NR: WSS Websocket UPGRADE request
    
    activate NR
    Note right of NR: Headers/cookies no longer available
    NR-->>client: 101: Switching Protocols

    NR-->>client: uibuilderCtrl: "client connect", cacheControl: "REPLAY"
    client-->>NR: uibuilderCtrl: "ready for content", cacheControl: "REPLAY"
    