Questions tagged [socket.io]

Socket.IO aims to make real-time apps possible in every browser and mobile device, blurring the differences between the different transport mechanisms. It supports multiple transports, such as WebSockets, Flash sockets, long polling, and more, automatically falling back when a transport fails.

Socket.IO is a Node.js package designed to make real-time applications possible and easy in every browser and mobile device. It supports the following transport mechanisms:

  • WebSockets
  • Adobe® Flash® Socket
  • AJAX long polling
  • AJAX multipart streaming
  • Forever Iframe
  • JSONP Polling

Socket.IO includes a JavaScript library that allows for easy programmatic communication with the server.

Some interesting Socket.IO features include:

  • Automatic JSON serialization
  • Namespacing connections over a single multiplexed connection
  • Volatile messages
  • Rooms (logically grouped connections)

API documentation can be found on the project's Wiki.

Useful Links:

20688 questions
5
votes
1 answer

socket.io session does not update when req.session changes

I am currently working on a basic app where a user needs to authenticate (with passportJS) and then send a message to my server with socket.io. Here is the nodeJS code: var express = require('express'); var path = require('path'); var favicon =…
achauchet
  • 65
  • 1
  • 7
5
votes
2 answers

How to generate a room id and force two users to join that room?

Im building a chat application in node.js , socket.io and mongoose. My goal is to build a one on one chat, it is similar like facebook web chat. So basically whenever I click on a user it will go to that user url and possibly chat with him/her But…
Jack Moscovi
  • 2,195
  • 7
  • 30
  • 49
5
votes
0 answers

How to get webpack hot module replacement (react-hot-loader) working when proxying own socket.io server

I have a node express app that is using socket.io. This app is proxied through webpack's dev server as I want to use hot module replacement in the client side react app (which communicates back to the socket code on the node app.) If I add my…
Nick Meldrum
  • 1,141
  • 1
  • 10
  • 27
5
votes
1 answer

node.js + socket.io: auction website development

I am currently working on an auction script using node.js and socket.io.But site was developed by using PHP & MySQL. Here I'm using node.js + socket.io for auction bidding process only. The site will have 500-1000 logged in users viewing a single…
5
votes
1 answer

Socket.io client with non-socket.io server

I trying to connect to the non-socket.io websocket server using socket.io client. But I can't to do it. I'm trying to connect to socket server like this: var socket = io.connect('wss://url-to-socket-api/'); And getting the error: XMLHttpRequest…
Dmytro Medvid
  • 4,988
  • 3
  • 25
  • 29
5
votes
2 answers

Golang websocket handler

I've started learning Golang after writing in Node.js for a long time and I'm a bit curious as to how am I to implement a handler - I've opted to use Gorilla Websocket since I understood it's the most reliable package out there. In socket.io for…
Random
  • 431
  • 8
  • 20
5
votes
0 answers

sails.js socket.io through nginx shows lots of 'upstream timed out'

I'm running a couple of sails.js backend instances behind an nginx proxy with sticky sessions. I keep seeing a lot of messages in my nginx error.log regarding sails.js /socket.io/ URLs timing out: 2016/01/04 20:55:15 [error] 12106#12106: *402088…
serjrd
  • 81
  • 5
5
votes
2 answers

socket.io 'disconnect' not called if page refreshed fast enough

I have the following abridged code: io.on('connection', function(client) { client.uuid = uuid.v4(); // add client object to server... console.log('socket.io:: client connected ' + client.uuid ); client.on('disconnect', function()…
Moo
  • 3,369
  • 4
  • 22
  • 41
5
votes
2 answers

ERR_CONNECTION_REFUSED http://localhost:3000/socket.io/socket.io.js

Ciao, I'm implementing a webRTC many-to-many videoconferencing system, actually, I already did it, I am using socket.IO as signalling server, and everything goes super well, I am using EnterpriseDB Apache for serving my .html file on port (8081) and…
5
votes
2 answers

socket.io client: how to determine if a handler is already installed

What happens if you call the 'on' method multiple times for the same function on a socket? Does calling it multiple times simply overright the last registered function or does it use more resources? If it is the later, then how do you determine if…
SPlatten
  • 5,334
  • 11
  • 57
  • 128
5
votes
2 answers

How to Sync countdown timer with Server from Android Application

A Countdown Timer is started from Node.js Server, and when starting a countdown timer a socket event(with countdown ~20s) is broadcasted to all connected clients(Android App) using Socket.IO. And sometimes due to slow internet connection or due to…
Valamburi M
  • 692
  • 4
  • 17
5
votes
0 answers

Reload partial code with Werkzeug reloader

I have a python Flask app using blueprints and socketio that loads a big model (5GB) into memory before starting the app, like so: launcher.py import app from model import load_model if __name__ == "__main__": load_model() …
appel
  • 517
  • 2
  • 7
  • 19
5
votes
0 answers

Play framework vs SocketIO how to integrate them?

So we want a Play! application which can communicate with a SocketIO (javascript) client. What I've tried so far: Using a Play! build in WebSocket and send an exactly same string as the node.js server did. The result is simply not working. I can see…
tg44
  • 810
  • 1
  • 8
  • 21
5
votes
2 answers

LibGDX - Connecting cross-platform clients to a server (HTML5/GWT, iOS, Android and Desktop)

Over the weekend I set up all the networking for a game I was making. I was basing it off this tutorial: GamesFromScratch.com Basic LibGDX Networking. It said that it only supported TCP but I was okay with that since I could figure something out and…
vedi0boy
  • 1,030
  • 4
  • 11
  • 32
5
votes
1 answer

WebRTC videoconferencing (many-to-many)

I am about to build a videoconferencing system using webRTC+socket.io+node.js, so I have read this book as start point "Real Time communications with webRTC" by Simon Pietro Romano, I already finished reading it, I am gonna run this system over a…