Skip to content
Advertisement

Tag: socket.io

Socket.io – limit connections per IP address

Is there a way to limit the number of connections to a socket.io server from the same IP address? For example, I could set the limit to 3, and then when someone opened 4 tabs to join the server, three of them would connect and the fourth or any after wouldn’t get connected. I’m not trying to cap the number

Screen sharing issue in WebRTC/nodejs with socket.io

im working on a vidoe conferencing application and I cant seem to get the screen sharing working getting an error “mediaTypeError: Cannot read properties of undefined (reading ‘getSender’)”. The screensharing is able to start but nothing is being shared This is my server file. Codes for screensharing where there seem to be an issue with getSender Github link for the

Socket listener not getting updates from React state

I have a component in which I set my state from the passed parameters to the component I set the activeList state from the passed params and then on click I update the state in order to show filtered results So ultimately users can filter their chat lists based on the chosen index And everything works fine, the DOM is

Why is the client not receiving the socket.io broadcast (rooms)?

My client is not receiving the broadcast sent to the room. If I replace socket.to(roomName).emit(‘join’, currentUser); with socket.emit(‘join’, currentUser); the client receives the broadcast, but I’d like to use rooms here. Any help would be greatly appreciated. app.js game.ejs Also, could I replace this: with this: Answer According to the documentation, if you use socket.to(‘room’).emit(…) instead of io.in(‘room’).emit(…), it will

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

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 this ex below in the backend. then retrieve all these data through the sockets object eg. But now the io.sockets.clients is not working anymore and is not recognized as a function.Every API provided seem t return

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 listener for that element. The addNewGauge() function works, and the listener is picking up the event, which I know because the error below occurs for

Advertisement