How to access form data sent to Flask using web sockets? I receive invalid frame header in google chrome developer tools->console. Extract from my javascript code: How would I access, say ‘title’ field in my_form from flask ? request.form throws the same error “Invalid frame header”…
Tag: socket.io
disconnect client from socket.io id
I can connect specific player to specific room like: And documentation says that ‘you can use leave method to leave room’ like: But I just want any client to leave using io object instead of socket. I need something like: Is there any way to leave client from room using just socket id with io obje…
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 Node.js for serving socket.IO on port (3000), It is wo…
Which is the prefered way to add function to sockets in socket.io?
Is there a “prototype” of all sockets connected to socket.io? I want to define some functions that will be available for each connected socket. Currently i have: But i’m defining a ‘new’ hello function for each socket. Is there a socket prototype? so i can have something like: An…
Client Socket.io disconnects and reconnects to websocket persistently
I am connected via Socket.io 1.3.4 (via websockets) to the NodeJS server and client socket.io fires up “disconnect” event 5-30 seconds. Every “disconnect”->”reconnecting”->”reconnect” iteration takes approx. 2 seconds. I am connected via cable to pretty st…
node.js TypeError: path must be absolute or specify root to res.sendFile [failed to parse JSON]
[add] So my next problem is that when i try adding a new dependence (npm install –save socket.io). The JSON file is also valid. I get this error: Failed to parse json So I’ve been trying to figure out why this error has been returning. All of the files (HTML,JSON,JS) are inside the same folder on …
Socket.io error hooking into express.js
I’m trying to hook socket.io and express.js together: At the line: var io = require(‘socket.io’).listen(app); I’m getting an error: There doesn’t seem to be anything on SO/google about this error… Answer You can do it without using http module app.listen return a server ins…
Socket.io not sending cookies in the handshake causing the request to stall
Let me explain my setup. I have multiple domain names that are all CNAME records for a main domain name, such as example.com. example.com -> serverIP company1.example.com -> example.com company2.example.com -> example.com I’m basically developing white labeled versions of our software, where th…
Socket.io – listen events in separate files in node.js
For example my idea is: File1.js File2.js This code is for a node server, will I have problems with this code? Answer Nope, just use the same “io” object. File1.js File2.js app.js index.html
How to add rooms in Node.js with Socket.io?
I have been following up many articles to learn making chat application with Node.js and Socket.io. Everything is clear and I can make an application moving messages from client to server and emitting to all etc but only one thing is not clearing and cannot figure this out. How can I add rooms to io.sockets.m…