Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

848
Views
TypeError: io.of(...).sockets.get is not a function

Here i'm using socket.io-redis when i'm calling provider_join method rooms = io.of("/").sockets.get(providername); the room is getting TYPEERROR, please help me thanks in advance

    const express = require('express')
    const app = express()

    const server = require('http').createServer(app)
    const io = require('socket.io')(server)
    const redisAdapter = require('socket.io-redis');
      io.adapter(redisAdapter({ host: 'localhost', port: 8000 }));
      io.of('/').adapter.on('error', function(){});

     var room;

io.on('connection', (socket) => {

socket.on('provider_join' , (providername) => {
     rooms =  io.of("/").sockets.get(providername);
    if(room == undefined){
        socket.join(providername)
        room = io.of("/").sockets.get(providername);
        socket.emit('room_created', providername);
    }else {
        socket.emit('room_already_created', providername);
    }
})
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!