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
0
votes
0 answers

Socket.IO disconnecting first user in room

I am having trouble with having the first user of the room I am trying to communicate to always leaving but this only happens when I check for its id. socket.on('player moved', function(msg) { var curr_room = msg.room_number; var room_data =…
0
votes
1 answer

socket.io v1.1 beforeSend?

Is there a way to globally and automatically modify a message before emitting it? Something along the lines of jQuery ajax's beforeSend. Right now, I'm manually adding a timestamp to the payload for each emit and it would be much less error-prone to…
lastoneisbearfood
  • 3,955
  • 5
  • 26
  • 25
0
votes
1 answer

Is it possible for Socket.IO Event Handling to be like AJAX call event handling declaration?

When we are having and ajax call in jquery we can write it this way: $.ajax({ url: 'http://localhost/url', type: 'GET', dataType: "json", data: {name : "data"}, beforeSend : function(){ ... }, …
leonard.javiniar
  • 539
  • 8
  • 25
0
votes
0 answers

Announce socket disconnection to previously joined rooms

I'm new to socket.io 1.1. From what I understand, upon connection loss/disconnection, the server-side socket automatically leaves all rooms and disconnect is fired. By the time disconnect is fired, socket.rooms is already cleared. I would like to…
lastoneisbearfood
  • 3,955
  • 5
  • 26
  • 25
0
votes
1 answer

Integrating node.js, socket.io and php web page

I am going to integrate my php web page with node.js and socket.io. The client can connect to node.js server file but the socket.emit function does not work from client to the server or return. Here is my nodeClient.js file: var socket = io.connect(…
Ahad
  • 37
  • 1
  • 1
  • 7
0
votes
1 answer

Sockets are always not authenticated

I've just configured my express (4.x) + socket.io(1.x) + angular.js app and my app looks like Express app.use(session({secret:"mysecret",store:new RedisStore({ host: 'localhost', port: 6379, client: redis }), cookie: {httpOnly: false,secure:…
Filip Lukáč
  • 100
  • 1
  • 2
  • 13
0
votes
2 answers

Loop through all sockets in socket.io v1

k so I try for 1 hour now and it still not working I want to get id of every socket.io user so I tried this: var socket_list = new Array(); io.on('connection', function (socket) {... socket_list.push(socket); ...} then for(var soc in socket_list)…
Shark
  • 23
  • 4
0
votes
1 answer

Use loopback token authentication for authentication of socket.io

I'm working with loopback 2.0 and socket.io 1.0.6. I'd like to use loopback authentication method for authencation of socket.io. I found the method to authenticate users in…
kechol
  • 1,554
  • 2
  • 9
  • 18
0
votes
1 answer

socket io 1.1 . Configure the number of reconnections

Currently I have the following situation. My socket.io (socket.io 1.1.0) application works, but when it fails it makes infinite amount of attempts to reconnect. I want to have some upper limit. Say if after 5 reconnects the app is still failing -…
Salvador Dali
  • 214,103
  • 147
  • 703
  • 753
0
votes
1 answer

socket.io: How to send data to server when the socket disconnect?

I want to send some data with disconnect emit when the socket is disconnected. Is it possible to do this or i have to emit disconnect myself? I'm using socket.io-1.0 thanks.
Mosayeb
  • 163
  • 1
  • 1
  • 12
0
votes
1 answer

socket.io real time webapp with three player in game?

I'm new with socket.io and node.js but I love it and I have to solve a problem. my scenario looks like the following: S* = my Node.js Server A* = my first webapp client B* = my second webapp client 1) A* first contact S*, opens a connection and…
Endriu
  • 25
  • 1
  • 3
0
votes
2 answers

Emit to a specific client with socketId via Socket.IO 1.0

I know it's very popular question, but i didn't find answer for my question. Very similar question: socket.IO: how can i get the socketid when i emit to a specific client in socket.io 1.0 I want emit to a specific client with socketId, But i get an…
Eldar Nezametdinov
  • 1,917
  • 4
  • 21
  • 23
0
votes
2 answers

socket.io - TypeError: Cannot read property 'handshaken' of undefined

I'm getting the error "TypeError: Cannot read property 'handshaken' of undefined" when using my app since I've installed socket.io It seems that the checkUserHaveConnect method within the helpers/utils.js file is causing the error as my…
Anthony
  • 446
  • 6
  • 15
0
votes
1 answer

socket.io with mocha test, The Should assert not throw error

my test For easy read, I delete some code. I send a message hello to client1: client1.emit('chat_to_user', {user: 'user2', message: 'hello'}) And client2 listen chat_to_user event. it('chat', function(done) { client2.socket.on('chat_to_user',…
user3160143
  • 698
  • 1
  • 10
  • 15
0
votes
1 answer

Socket.io, Codeigniter, Redis session store to create push notifications

I have a codeigniter app I want to implement push notifications for. I use mysql as backend database, but I use redis as the session store so I can use it with node (just preference). When a user connects to node they pass there session id via the…
CaptRisky
  • 751
  • 4
  • 13
  • 25
1 2 3
16
17