Closed lgg closed 8 years ago
Server debug:
socket.io:server incoming connection with id 1fX2a9tSW67s86bOAAAd +630ms
socket.io:client connecting to namespace / +1ms
socket.io:namespace adding socket to nsp / +1ms
socket.io:server incoming connection with id ElBX5J56jGg2AL-RAAAe +3ms
socket.io:client connecting to namespace / +2ms
socket.io:namespace adding socket to nsp / +1ms
socket.io:client client close with reason transport close +2ms
socket.io:client client close with reason transport close +1ms
socket.io:server incoming connection with id JM1_bp5eVOvNlyC-AAAf +2ms
socket.io:client connecting to namespace / +2ms
socket.io:namespace adding socket to nsp / +1ms
socket.io:server incoming connection with id 5kOM-EtYOCmRrgZ7AAAg +4ms
socket.io:client connecting to namespace / +2ms
socket.io:namespace adding socket to nsp / +0ms
socket.io:namespace next called after client was closed - ignoring socket +4ms
socket.io:namespace next called after client was closed - ignoring socket +5ms
socket.io:namespace next called after client was closed - ignoring socket +2ms
socket.io:namespace next called after client was closed - ignoring socket +1ms
On network tab
On client:
On server:
var http = require('http'); //http module from node.js
var staticserver = require('node-static'); //http server for serving static files
//Create static serving server from 'client' folder
var file = new staticserver.Server('./client');
server = http.createServer(function (request, response) {
request.addListener('end', function () {
//
// Serve files!
//
file.serve(request, response);
}).resume();
//Start socket.io server
startSocket();
}).listen(port);
var options = {
pingTimeout: 3000,
pingInterval: 3000,
transports: ['websocket'],
allowUpgrades: false,
upgrade: false,
cookie: false
};
io = require('socket.io')(server, options);
I used node-static
for serving files, with it socket.io doesn't work. With express or default node(http) it works.
Here an example: https://github.com/littleguga/websocket-test
@lgg is this issue solved? I have got the same problem
@rizkiaditya24 i used express.js instead of node-static
Same issue. Any one have solution for it? Error: WebSocket connection to 'ws://192.168.0.160/socket.io/?EIO=3&transport=websocket' failed: Invalid frame header
@rrpatilcse what server you are using? expressjs?
i used nginx proxy django websoket service.now no way got it!throw "WebSocket connection to failed: Invalid frame header"
@zengliangbigdata show your nginx config, i think it could be troubles with proxy_pass
Same issue here.
VM41:164 WebSocket connection to 'ws://localhost:1337/socket.io/?EIO=3&transport=websocket&sid=dl2GgAoz02RW0OjCAAAC' failed: Invalid frame header
In the node.js console got this messages:
info: Client disconnect: NaN error: Can not find client NaN on disconnect
I'm using Chrome and have this error. Everything works fine in IE.
Same issue, I only get the error in the chrome console
Same issue, I only get the error in the chrome console
SAME.. do you find any solution??
same!! someone tell me what's going on
Hi, I have encountered the same issue.
I am using NodeJS (LTS v12.18.1) with ExpressJS (v4.17.1) and Socket.io (v2.3.0).
Here is my server.js
`const express = require('express');
const app = express();
const server = require('http').createServer(app);
const io = require('socket.io')(server);
app.get('/',(req,res) =>{ // do something });
io.on('connection' ,socket => { // socket events handling });
server.listen(3000);`
Has anyone found a solution?
Hi, I have encountered the same issue.
I am using NodeJS (LTS v12.18.1) with ExpressJS (v4.17.1) and Socket.io (v2.3.0).
Here is my server.js
`const express = require('express');
const app = express();
const server = require('http').createServer(app);
const io = require('socket.io')(server);
app.get('/',(req,res) =>{ // do something });
io.on('connection' ,socket => { // socket events handling });
server.listen(3000);`
Has anyone found a solution?
same issue... please if anybody found solution.. then drop here
Same here
WebSocket connection to 'ws://localhost:5000/socket.io/?EIO=4&transport=websocket&sid=NMbkrqJ9ePqRI5IeAACL' failed: Invalid frame header
@marcosybarraa @pdeivaraj @whoakashtyagi
Im not sure, that yours' issues are the same to mine. I was trying to host static web-files with node-static
and socket.io
, changing libraries to express.js
with socket.io
helped to me. Also, there are some more "up to date" libraries for working with sockets, rather than socket.io
(which seems a little bit abandoned)
Check this out: https://github.com/websockets/ws https://deepstream.io/ https://github.com/desertbit/glue
Also check this: https://github.com/facundofarias/awesome-websockets
same problem
@lgg thanks for your reference
Hi, I have encountered the same issue.
I am using NodeJS (LTS v12.18.1) with ExpressJS (v4.17.1) and Socket.io (v2.3.0).
Here is my server.js
`const express = require('express');
const app = express();
const server = require('http').createServer(app);
const io = require('socket.io')(server);
app.get('/',(req,res) =>{ // do something });
io.on('connection' ,socket => { // socket events handling });
server.listen(3000);`
Has anyone found a solution?
Same issue. Has anybody found a solution for this?
Bump
For me the answer was that I was connecting with a client that was version 2 and the server was running version 4. As per the docs I had to enable allowEIO3
on the server
For me the answer was that I was connecting with a client that was version 2 and the server was running version 4. As per the docs I had to enable
allowEIO3
on the server
resolved
https://socket.io/docs/v4/server-options/#alloweio3 this worked for me, which is strange, because my socket.IO client is version 4
same issue, occured when trying to initialize on server PeerJS and SocketIO, starts fine if PeerJS disabled
WebSocket connection to 'ws://10.1.30.58/socket.io/?EIO=3&transport=websocket' failed: Invalid frame header
server debug:
On client side:
var socket = io({transports: ['websocket']}); //socket.io
What's wrong?