~johnteske/vs-websockets

3ac8dc2f — John Teske 3 years ago
Update dependencies
dcb5e807 — John Teske 3 years ago
Merge pull request #1 from vectorscores/ts
909fd167 — John Teske 3 years ago
Update README

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~johnteske/vs-websockets
read/write
git@git.sr.ht:~johnteske/vs-websockets

You can also use your local clone with git send-email.

#websockets

#Build

npm run build

#Running WebSocket server

node dist/

#Message format

[id, type, msg[, data]]

Example (play from score event 2): ["1b2d3f", "vs", "play", 2]

#Message types

#ws (WebSocket)

[id, type, msg[, data]]

  • connection open ["id", "ws", "open"]

  • number of connections ["id", "ws", "n", "2"]

  • connection closed ["id", "ws", closed"]

  • reload all pages ["id", "ws", "reload"]

#vs (vectorscores)

[id, type, msg[, pointer]]

  • play ["id", "vs", "play", 0]

  • pause ["id", "vs", "pause", 6]

  • stop ["id", "vs", "stop"]

  • step ["id", "vs", "step", 4]

#Custom messages

[id, type, msg[, data ...]]

  • choice ["id", "choice", "F#"]