socket.io Get data io.sockets.clients(); Not working anymore

This was working fine before, why did they remove it? Before you can create objects with user properties on frontend and assign it to the socket.user property for each connection using a code like …

How to update state of array element during listener in React?

I’m working on a web app that reads sensor data to gauge objects via socket.io. The function addNewGauge() adds an element to the component’s array of gauges, but I also want to install a socket.io …

ES module imports – can it always be done? A failed example trying to import socket.io-client

I’m trying to use a “build-less” process so I’m using a plain module script in an html file (following the Preact docs): import { html, …

Setting Socket.io room variables

I would like to store some information in the socket room variables, but am getting the following error: UnhandledPromiseRejectionWarning: TypeError: Cannot set property ‘host’ of undefined This is my …

Unable to connect to socket – Vanilla JS to node.js

I am trying to work with socket.io, however I am unable to establish a connection between my client (Vanilla HTML/JS) and my server (node.js). Server code: const express = require(‘express’); var cors …

socket.io broadcast in a room

I am trying to use socket.io to broadcast only to users of a specific room (in another word, to send to all users in that room except me, the sender). So far, I have tried: io.of(“/”).in(…

How to stringify js object, so that multiple double quotes are possible when sending it over Socket.io

Well, i guess the main problem is defined in the title, but some special info is: Im trying to emit events to a socket.io api. For the eventtype part this is working fine, but when using JSON….

How to add side effect to creating new record in Strapi by customizing controller?

I am trying to trigger a side effect (send notification, using socket.io) when adding new record in Strapi. The socket setup is OK, successfully emitting from back-end (Strapi API) to front-end. I …

Unable to change camera / stream for WebRTC call

Source: https://github.com/anoek/webrtc-group-chat-example/blob/master/client.html I’m trying to modify this Webrtc example to add the ability of changing camera (Cross-browser support). Normal …

disconnect client from socket.io id

I can connect specific player to specific room like: socket.join(‘sampleroom’); And documentation says that ‘you can use leave method to leave room’ like: socket.leave(‘sampleroom’); But I just …