ganimomer / hackathon-editor-collab-server

Repo for the websocket server for hackathon

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hackathon-editor-collab-server

Repo for the websocket server for hackathon

Message API

(protocol version 4)

Glossary

  • Participant β€” anyone connected to the session
  • Presenter β€” a participant currently editing the site 🐡
  • Spectator β€” a participant following the presenter's activity 🐠

Server β†’ Client

session 🐡 🐠

Object { id, participants: { id:name }, presenterId, snapshot? } 
// session spectator data and (optionally) state snapshot

spectator-joined 🐡 🐠

Object { spectatorId, name } // 'spectatorId' has joined the session

spectator-left 🐡 🐠

Object { spectatorId } // 'spectatorId' has left the session

presenter-changed 🐡 🐠

Object { presenterId } //  'presenterId' has become the presenter

control-requested 🐡

Object { spectatorId } //  spectator 'spectatorId' requested control

control-denied 🐠

//  participant's control request was denied

request-snapshot 🐡

// newly connected spectator requests state snapshot

change 🐠

Object change // got a change from the presenter

chat 🐡 🐠

Object { participantId, message } // got a chat message

Client β†’ Server

join 🐡 🐠

Object { name, siteId } // user 'name' joins session 'siteId'

snapshot 🐡

Object { snapshot } // presenter sends snapshot

change 🐡

Object change // send a change to spectators

chat 🐡 🐠

Object message // send a chat message to everyone in the session

request-control 🐠

// request presenter control

take-control 🐠

// unconditionally take presenter control

grant-control 🐡

Object { spectatorId } // grant presenter control to 'spectatorId'

deny-control 🐡

Object { spectatorId } // deny presenter control to 'spectatorId'

About

Repo for the websocket server for hackathon


Languages

Language:JavaScript 96.9%Language:HTML 2.7%Language:Shell 0.4%