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
2 answers

Using Redux on the Server and on the Client

Lately, I've been building Universal web apps using two redux stores: one on the client and one on the server. Redux seems like a great tool for managing state data. Is it ok to use Redux for stuff outside of React? Could you use Redux in a command…
Tabbyofjudah
  • 1,973
  • 3
  • 17
  • 29
5
votes
1 answer

Socket.io and node.js, can't understand memory usage

I currently use socket.io v1.4.2 and node.js v0.10.29 on my server. I try to track a memory leak in my app, I'm not sure, but I think socket.io is a part of my problem. So here a code of the server (demo example): var server = require…
5
votes
1 answer

Socket.io can't connect in nginx + node.js + php app

I'm trying to run nginx with PHP app and node.js together (this part works fine). Additionaly I would like to add socket.io to this setup, but unfortunatelly I can't establish connections between client and server (looks like connection time…
user1409508
  • 623
  • 1
  • 12
  • 38
5
votes
2 answers

Using pm2's cluster module with socket.io and socket.io-redis

I'm trying to make pm2 cluster module work with socketio, but I get errors when I visit /hello. Given that cluster utilizes all CPU cores, socketio gets confused, so I installed socket.io-redis module to take care of this, but it looks like it…
salep
  • 1,332
  • 9
  • 44
  • 93
5
votes
0 answers

listening to a socket with socket.io-redis module

With socket.io-redis module we can easily emit/broadcast message with saved-socket-id. io.to(socket-id-from-redis).emit('serverEvent', "some message"); On the otherhand, what's the best way for listening to the socket with out any extra/external…
Cem Ozturk
  • 51
  • 2
5
votes
1 answer

Best way to build push notification system using express.js and socket.io

i am using express.js and socket.io together for realtime push notification system. which are working fine, i share some line of code which i am using on server side var app = express(); var server = require('http').Server(app); var io =…
Meesam
  • 109
  • 1
  • 10
5
votes
0 answers

Socket.io, clean/disable buffer or cache

I'm using Socket.io client and I noticed that if the connection is lost(I closed the server) Socket.io will try to reconnect, while it reconnect I can still call emit(), the problem is that when I reactivate the server, Socket.io saved all my emit()…
Aviel Fedida
  • 4,004
  • 9
  • 54
  • 88
5
votes
1 answer

socket.io broadcast from client

I just started with socket.io, and I want some function which will broadcast somethink from one client throuh server to all clients. For example I will have game, when I will need handle a lot of things. There is two option: 1. Every call handle on…
Hadik
  • 95
  • 1
  • 4
5
votes
1 answer

Node clustering with websockets

I have a node cluster where the master responds to http requests. The server also listens to websocket connections (via socket.io). A client connects to the server via the said websocket. Now the client choses between various games (with each node…
InsOp
  • 2,425
  • 3
  • 27
  • 42
5
votes
3 answers

Socket.io Android HTTPS - Connection Error xhr poll error

I'm developing a chat application with HTTPS. This is the Socket.IO I've used Server First of all I developed the server with node.js and node module "socket.io": "^1.4.5" In the server I have this: var secure = { ca: fs.readFileSync('ca.pem'), …
RMH
  • 169
  • 1
  • 14
5
votes
3 answers

New in Socket.io, How to prevent Socket.io client script hacking

I'm new in Socket.IO, and I've just implemented the tutorial instruction about Socket.IO at http://socket.io/get-started/chat/. It's quite interesting. But now I have a concern about security. The client code for sending message is: