Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS: Sockets #19

Open
dahrk opened this issue Nov 9, 2020 · 0 comments
Open

FS: Sockets #19

dahrk opened this issue Nov 9, 2020 · 0 comments
Assignees

Comments

@dahrk
Copy link
Contributor

dahrk commented Nov 9, 2020

  • use this package socket.io for real-time notifications
  • Setup socket server on the backend
  • Setup client connection (should connect if the user is authed - see code below)
  • We also want an object to keep track of which users are currently connected - using a service, a database like Redis, or we can for now just use an in-memory variable (not recommended for the future, but it works for this project)
    • const cache = {}; (works for single instance)
      io.on('connect', (socket)=>{
      socket.headers.cookies[''] // can do some validation here
      socket.disconnect()
      })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants