Skip to content

jonathan-shahen/example-websocket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example Websocket Projects

Live Cursor Update

A quick example of Node Express + ws Websocket library to show the (x,y) position of all cursors connected to the server.

The cursor that is bolded is your cursor. It will always appear above other cursors

Inspiration: https://ably.com/blog/web-app-websockets-nodejs

How to test

Live Cursors example

  1. Git clone this repo
  2. cd live-cursors
  3. npm install
  4. npm start
  5. Open Multiple browser tabs/windows to http://localhost:3000/
  6. Move the mouse on all of them to see the live updating

Pub/Sub Messages

A quick example of Node Express + ws Websocket library to show an implementation of publish/subscribe, with dynamic subscriptions.

How to test

Pub Sub example

  1. Git clone this repo
  2. cd pub-sub
  3. npm install
  4. npm start
  5. Open Multiple browser tabs/windows to http://localhost:3000/
  6. Add and remove subscriptions

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published