So1ene / websockets-cursor-sharing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

websockets-cursor-sharing

How it's built

  • /app is the browser application
  • /api is a node.js web sockets server
  • Web app connects to web sockets server
  • On connection, each client is assigned an id and a color.
  • On mouse move, coordinate updates are sent to the server
  • The server adds the client's id and other metadata
  • The enhanced message is sent to all the clients.

What's in here?

This repository contains two demos which share cursor positions over WebSockets. One using WS in the main branch and one using SockJS in the SockJS branch.

Running this sample

This demo includes two applications, a web app, that we serve through Snowpack, and a Node.js webserver. The NPM start task will spin up both the API and the webserver.

> npm install
> npm run start

About

License:Apache License 2.0


Languages

Language:JavaScript 79.1%Language:HTML 16.5%Language:CSS 4.4%