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

Socket.io custom namespace clients do not receive an error from main middleware

I am developing a project with socket.io communication. The basic structure is that I have set up a custom namespace which requires authentication. I provide authentication through JWT (Json Web Tokens). My problem is the following. Authentication…
mitsos1os
  • 2,170
  • 1
  • 20
  • 34
5
votes
3 answers

Laravel Homestead , Socket.io Connection Refused

I`m using laravel Event broadcasting , socket.io , node.js , and redis to pass notifications to the client side in real time. The code is fairly simple, when i make a get request to '/' on the server an event will be fired and some data will be…
Abdelrahman Magraby
  • 1,053
  • 1
  • 12
  • 16
5
votes
4 answers

TypeError: io.sockets.clients is not a function

I am following the tutorial at this link (step 7). I successfully installed both node.js either socket.js , but when i go to the page and try to send the image i get this error on the server Missing error handler on `socket`. TypeError:…
elgeko
  • 127
  • 1
  • 1
  • 11
5
votes
2 answers

What does 304 not modified means in console status means?

I am studying node js with simple chat. Here's my sample code: server.js var mongo = require('mongodb').MongoClient, client = require('socket.io').listen(8888).sockets; index.html
Jerielle
  • 7,144
  • 29
  • 98
  • 164
5
votes
2 answers

Screencast website with Socket.IO and Node.JS

I am trying to realize a screencast of a website without any software required but a browser. It is not neccessary to really screenscast the website. Maybe it would be a good solution to "rebuild" the website with information like browser,…
rakete
  • 2,953
  • 11
  • 54
  • 108
5
votes
2 answers

What utility of express.io VS express + socket.io?

I discover socket.io and chat exemple here : https://github.com/rauchg/chat-example/blob/master/index.js They use directly require('express') AND require('socket.io'). So what the differences, the advantages, to use : require('express.io') like…
Matrix
  • 3,458
  • 6
  • 40
  • 76
5
votes
3 answers

How to run Ratchet remotely or on a server?

Everything works fine on my local machine on XAMPP. But after I uploaded the files to a server, it gives a error like this... Fatal error: Uncaught exception 'React\Socket\ConnectionException' with message 'Could not bind to tcp://0.0.0.0:8080:…
Jimut
  • 195
  • 3
  • 13
5
votes
1 answer

How I can get a socket.username ? (socket.io)

I want to write a simple chat for practical experience. All right, but I can't get a socket.nickname for notice a join/leave from the room. (when I tried pass its, he always sad a 'undefined'). Now all right, tried to create list of rooms UPDATE…
vagabund
  • 73
  • 1
  • 1
  • 6
5
votes
1 answer

Connecting to socket.io socket with R

I am trying to connect to a socket.io socket in R using the R function socketConnection(). However, although I am able to set up the socket properly, I am not able to read data from it into R. The javascript code I use to set up the server is: var…
jeromefroe
  • 1,345
  • 12
  • 19
5
votes
2 answers

Getting missing error handler socket message using Node.js and Socket.io

Hi i am getting the following error which run the server using Node.js and socket.io. Error: Missing error handler on `socket`. TypeError: Cannot read property 'connected' of undefined at Socket. (C:\Documents and…
satya
  • 3,508
  • 11
  • 50
  • 130
5
votes
2 answers

Correct way to restart a socket.io server

I'm trying to restart a socket.io server. I start the server and get a welcome message for new connections, but when I close and restart the server I get no further welcome message. Hopefully I'm missing something simple :\ var http =…
blented
  • 2,699
  • 2
  • 23
  • 17
5
votes
1 answer

Socket.io get the namespace a socket belongs to

Is there a way to get a sockets namespace? I've tried various things but cannot get it to work. Given a socket object I would like to be able to know what namespace it belongs to. Thank you very much. for example nsp = io.of('/' +…
patrick_corrigan
  • 809
  • 11
  • 24
5
votes
2 answers

Connecting to a socket.io namespace using the socket.io-client.java library

I can connect to socket.io web service no problem using this library https://github.com/nkzawa/socket.io-client.java . I cannot quite figure out how to connect to a specific namespace though. I have looked through the test code and think I might…
patrick_corrigan
  • 809
  • 11
  • 24
5
votes
1 answer

Where do sockets fit into the Flux unidirectional data flow?

Where do sockets fit into the Flux unidirectional data flow? I have read 2 schools of thought for where remote data should enter the Flux unidirectional data flow. The way I have seen remote data for a Flux app fetched is when a server-side call is…
evkline
  • 1,451
  • 3
  • 16
  • 34
5
votes
1 answer

socket.emit is not working in mobile chrome (but it works in incognito mode)

I have an application using socket.io, and socket.emit() is not working from mobile chrome (on Android and iOS). I can see that the socket.emit() is getting executed in the browser. But my server-side console.log statements in socket.on() are not…