Questions tagged [socket.io-1.0]

The latest version of Socket.IO library.

Socket.IO enables real-time bidirectional event-based communication. It works on every platform, browser or device, focusing equally on reliability and speed.

Migrating from 0.9.x

255 questions
91
votes
7 answers

Sending message to a specific ID in Socket.IO 1.0

I want to sent data to one specific socket ID. We used to be able to do this in the older versions: io.sockets.socket(socketid).emit('message', 'for your eyes only'); How would I go about doing something similar in Socket.IO 1.0?
user2283026
35
votes
4 answers

How do I get socket.io running for a subdirectory

I've got a proxy running that only hits my node.js server for paths that being with /mysubdir How do I get socket.io configured for this situation? In my client code I tried: var socket = io.connect('http://www.example.com/mysubdir'); but then I…
Drew LeSueur
  • 19,185
  • 29
  • 89
  • 106
35
votes
5 answers

How to get room's clients list in socket.io 1.0

I can get room's clients list with this code in socket.io 0.9. io.sockets.clients(roomName) How can I do this in socket.io 1.0?
uzimith
  • 411
  • 2
  • 6
  • 9
34
votes
2 answers

What do these numbers mean in socket.io payload?

When I am using native websocket API I can see just a payload in my chrome console for sockts: But when I use socket.io with their emit event, I can see some strange numbers before my actual payload. I do understand that colors mean that you either…
Salvador Dali
  • 214,103
  • 147
  • 703
  • 753
27
votes
1 answer

socket io, node js, Simple example to send image/files from server to client

Is there any plain and straight forward examples on how to serve an image? from server to client? through buffering or just a direct call to download? (the goal is to get image files in near real time efficiently to sort of present a near live…
Bigs
  • 616
  • 2
  • 11
  • 17
25
votes
1 answer

Socket.io connection reverts to polling, never fires the 'connection' handler

I'm trying to add socket.io to my existing node.js app on express. I've added the socket.io library in the server-side as follows (directly following http://socket.io/get-started/chat/): var express = require('express') , http = require('http') …
Edward Sun
  • 1,541
  • 3
  • 15
  • 26
23
votes
2 answers

socket.io client connect disconnect

I am unable to figure out why disconnecting / connecting a socket.io connection multiple times is not working ? Server side code: io.on('connection', function(socket){ console.log('a user connected'); socket.on('disconnect', function(){ …
Kaya Toast
  • 5,267
  • 8
  • 35
  • 59
22
votes
2 answers

How to store client associated data in socket.io 1.0

The docs say socket.io doesn't support .get .set now Is it okay to store client associated data like io.sockets.on('connection', function (client) { client.on('data', function (somedata) { client['data'] = somedata; }); …
Herokiller
  • 2,891
  • 5
  • 32
  • 50
19
votes
6 answers

Socket.IO 1.0.x: Get socket by id

In the 0.9.x version, we can get socket by ID like this: io.sockets.socket(socketId) But in 1.0.x we can't. How to find a socket by id in 1.0.x?
Dũng Nguyễn
  • 485
  • 1
  • 4
  • 20
18
votes
2 answers

How do I check the version of socket.io and update it

how can I check the version of socket.io that I am using ? and how do I update it if there is new release. Thank you in advance.
jemz
  • 4,987
  • 18
  • 62
  • 102
17
votes
1 answer

How to best structure an Express V4.11+ project with Socket.IO?

I've used the latest version of the express-generator (link) to generate a boilerplate Express 4.11.2 project. I'm trying to figure out the best way of setting up Socket.IO 1.3.3 with the changes that have been made a few major versions back in the…
Jamie Street
  • 1,527
  • 3
  • 14
  • 32
17
votes
2 answers

How to send binary data from a Node.js socket.io server to a browser client?

I've been looking through the entire Socket.IO docs, but, even though they promise it is there, I can't find a simple, minimal example, of how one would send binary data between server/client. How is it done?
MaiaVictor
  • 51,090
  • 44
  • 144
  • 286
15
votes
2 answers

Chat project - load balance with socket.io

I am involved in a development project of a chat where we are using node.js, socket.io (rooms) and mongodb. We are at the stage of performance testing and we are very concerned if the system needs a load balance. How can we develop if our project…
Renan Basso
  • 795
  • 2
  • 7
  • 19
14
votes
1 answer

Ajax vs Socket.io

I am developing a web app and I was wondering which method should be suitable for my project. Basically what I want to display to the users are some notifications which are taken from requests to other servers. My node.js app gets all the info and…
themazz
  • 1,107
  • 3
  • 10
  • 29
13
votes
1 answer

Differences between io() and io.connect() using socket.io

I would like to know what are the differences between var socket = io(); and var socket = io.connect(); using socket.io in my script (client side) Thank you!
Aidoru
  • 555
  • 1
  • 5
  • 16
1
2 3
16 17