Giter Site home page Giter Site logo

seminar's Introduction

Seminar

A socket.io platform for hosting seminars supporting multiple seminar rooms. To host a seminar room a password is required that is validated against a hash. Each room can be hosted by multiple hosts with one of the hosts being the chair. Anyone with access to the room parameters (including the hash) can join the room. Hosts can send announcements and messages while other participants can only send messages. When the chair leaves a room, another host becomes the chair. When the last host leaves a room, the room is closed and all remaining participants are kicked out.

Usage

npm install
npm run start

Alternatively, you can use npm run dev to run the server using nodemon.

Http and Https

By default an http server is started:

node server.js

If the path to a key and certificate are provided, an https server is started:

node server.js <path_to_key.pem> <path_to_cert.pem>

The key and certificate can be obtained, e.g., by following the instructions on https://certbot.eff.org/instructions.

Make sure to ensure that certificates are renewed when necessary, e.g. by adding a cronjob. When using automatic renewal, the server may have to be restarted. To manually (and forcefully) renew certificates using certbot you can use

sudo certbot renew --force-renewal

License

MIT licensed

Copyright (C) 2023 Asvin Goel

seminar's People

Contributors

rajgoel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

seminar's Issues

socket.io server crashes when leaving an unjoined room

Hi
I had quite a lot of crashes with socket.io server. Unfortunately I am not at all a JavaScript person and thus a little bit lost.

I have the followings:

/code/server.js:330
socketio_1 | if ( hosts[i].findIndex(host => host.id === socket.id) !== -1 ) {
socketio_1 | ^
socketio_1 |
socketio_1 | TypeError: Cannot read properties of undefined (reading 'id')
socketio_1 | at /code/server.js:330:40

and also at another place:

socketio_1 | /code/server.js:192
socketio_1 | const chair = ( user.id == hosts[i][0].id );
socketio_1 | ^
socketio_1 |
socketio_1 | TypeError: Cannot read properties of undefined (reading 'id')
socketio_1 | at leaveRoom (/code/server.js:192:24)
socketio_1 | at Socket. (/code/server.js:299:3)
socketio_1 | at Socket.emit (node:events:527:28)
socketio_1 | at /code/node_modules/socket.io/lib/socket.js:528:12
socketio_1 | at processTicksAndRejections (node:internal/process/task_queues:78:11)
socketio_1 |
socketio_1 | Node.js v17.7.1

Reproduce the case:

  • I have a presentation that allows the host to login (enter PW) and also to leave the hosting. The guests have also two buttons that allow to join (RevealSeminar.join_room();) and unjoin the room (RevealSeminar.leave_room();)
  • one computer opens the presentation and connects as a host
  • another computer opens the presentation and clicks to unjoin the room (he wasn't joined before)
    --> this reproduces the error at source code line 192

I assume that the variable user (host respectively) are empty and therefore the 'id' can not be accessed. What would be the best remediation ? Try-catch?

Thanks for your help

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.