Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Md. Alamin (Miraje)
    Hey, I am trying to implement a quiz game application, I am facing a problem with socket in nodejs and android, socketIO event fired multiple time, I already create question in stackoverflow, can anyone help please
    Hey @basavarajayyahtrigent ,you can try this one, it should worked: io.of('namespace').to('room').emit('event', somedata);
    Thomas Havlik
    I am having difficulty emitting a Uint8Array or a Buffer from a server to a jest test script running in a node environment. The message simply never arrives. I am attempting to send a buffer with a single zeroed byte, and it never arrives. Switching it to a string allows the message to arrive without issue
    I cannot emit it directly - io.emit("ev", buf) nor can I box it: io.emit("ev",{buf}) and io.emit("ev", { buf: buf.buffer }) all never arrive
    Thomas Havlik
    Switching the testEnvironment of jest.config.js back to jsdom (the default) fixes the issue... why?
    This is a bug.
    If Node -> Node connections cannot send buffers outside of jest, then this is probably a bug with socket.io
    nasreddine skandrani
    Hi guys
    i am working on an MVP.
    crafting with a baby is not easy :) i wish one of you can tell me more about this without having to google it
    basically i implemented something with some socket . Then i used "Smart WebSocket CLient" to hit my backend in nodeJS
    but i was using ws://localhost:3333
    it was not working
    i saw in the comment this ws://localhost:3333/socket.io/?EIO=3&transport=websocket i tried it and it works
    can someone tell me why these params are needed? (thanks for your time in advance)
    Dinesh Kumar
    need some help with socket.io
    John Edwards
    i created a site using socket io to help developers collaborate if anyones interested https://sharecode.online
    Is it possible to make socket.io connections live after Nodejs server restarts ?
    Phan Dang Dien
    Hi guys, I'm upgrading socket.io from 1.2.1 to 2.2.0, seems like from the first time, same namespace uses the same connection, but now it creates a new connection I'm I right?

    is it okay to add a custom attribute to a socket client?
    This seems possible but i am not sure if this is acceptable

    socket['identifier'] = assignedIdentity() // return 'id-5d5ce5d9c360990e7c325406'

    nvm found an example seems to be accepted method https://github.com/socketio/socket.io/blob/318d62/examples/chat/index.js#L36
    Vimal Mistry
    Hi everyone. can somebody explain me what is engine.io and socket-redis adaptor use?. Document doesnt help me to understand. Please.
    Md. Alamin (Miraje)

    Hy @vimalmistry ,
    EngineIO: To establish the connection, and to exchange data between client and server, Socket.IO uses Engine.IO. This is a lower-level implementation used under the hood. Engine.IO is used for the server implementation and Engine.IO-client is used for the client.

    with the socket.io-redis adapter you can run multiple socket.io instances in different processes or servers that can all broadcast and emit events to and from each other.

    Vimal Mistry
    @mirajehossain Thank you for explanation. I want to implement features like. when client is offline I can save event to redis or mongo whatever and when client will online it can autosend event. Is there any solutioin like this?
    Hello All,
    I have crated a chat application which has one to one and group chat facility. The Problem i am facing is like sometime a user from other country is not able join the group chat in which already two users is connected from same country. ex. if User A and User B are chatting in group and they are from same country Say X then if User C from Country Y is not able to join that group event though another User D with same country X has connected successfully to that group chat. so can you guys please explain me why i am facing this problem. is it related to socket io or any other thing
    Tarang Sachdev

    Hello folks
    I am having error
    socket.io websocket is already in closing or closed state
    I have used it in angular application

    Browser chrome : Version 79.0.3945.88 (Official Build) (64-bit)
    "socket.io-client": "^2.3.0”

    Priyank Vaghela

    Hello everyone,
    I have multiple Socket.IO nodes and a Redis adaptor to communicate between multiple nodes.
    In that when I broadcast a message - every user from every node does receive it.


    • When I send a One-to-One (user) message - the receiver does receive the message - but I’m unable to get the callback acknowledgement.

    Here's the error:

    Error: Callbacks are not supported when broadcasting redis
    Aviraj Khare
    Hello. I have built this simple game using socket.io. Please check: http://gocorona.codeignition.tech/game?game_name=global_game
    Aaron "PP"
    Hai, i am new to socket. I have a client running and when i restart server , client is receiving data multiple times . The image shows me try to send a ls\r command from server to client
    Screenshot from 2020-03-29 01-23-34.png
    can anyone help me with this? i am stuck and dont know what to do
    Vamshi Krishna Kesetty
    Hi..i have an issue that websocket is terminated and a new session is created when browser is refreshed...Do we have a solution for this?

    Hello guys, i have a problem with chat between 2 users without using a room.

    So each user when it connects i'm storing their socket id in a hashmap, on front end i have the socket for each user so when i'm sending message i'm using io.to('the user id).emit('chat message', msg);

    Now on frontend i'm listening to the socket.on('chat message', data => {
    pushing messages logic into an array that will be inside chat here

    The thing is that when i'm sending the message to the user i wanna send it to, he will receive the message it emits, but i won't be able to push my own message, because the socket id is different, he sees the message i don't, and by using 2 emits on server side one to my socket and one to his socket will cause bugs, do i really need to do rooms?

    If i use rooms, when i click on the avatar of any user i will need to emit a room creation, then i will send the message, then the user when he receives the message will need to do join room and then send message back right?
    This will mean that the room name will be the id of the socket that sended first the message right?
    Manjunath V A
    @TrofinSorin Before pushing emitting the message to backend, first push the message in font-end.
    hi i am getting CORS error in socket.io express js app
    when consuming from angular client
    Md. Alamin (Miraje)
    Hey @adibro500 , did you use cors cors into your application ??
    how to communicate socket.io through expressgateway, any example code please
    Hrishikesh Bawane
    Hello all, it would be a great help if anyone can help me out regarding this issue.
    Hi, is the reconnect event fired when you connect?
    thanks for help
    Hi, I'm using Socket.IO to send multiple different objects, some of which have Date properties. Now the weird thing is for one object the properties come out on the other side as Date objects, for another object they come out as strings. Any idea, what could be going on?

    Man, I need some vacation. I dumped the object on console right after receiving it from socket and at that point the date property is a string indeed. I forgot that some function later on modifies the object in place and converts the date. The console apparently displays the object in its current state, not the state it had when printed.

    So nevermind.

    jabir jaleel
    is there any disadvantage in replacing all restfull api with socket io