devtool icon indicating copy to clipboard operation
devtool copied to clipboard

Websocket server with devtool will auto disconnect

Open lishengzxc opened this issue 9 years ago • 3 comments

When I use devtool, my websocket server will auto disconnect to client. if I use node app.js, it will be right.

lishengzxc avatar Mar 03 '16 08:03 lishengzxc

i am using devtool with my websocket server and have no trouble i am running it with:

devtool app.js --watch --break

ckross01 avatar Mar 29 '16 18:03 ckross01

I'm experiencing the same issue with devtool index.js --watch. I'm using express and socket.io with the following setup:

const http = require('http');
const express = require('express');

const app = express();
const server = http.createServer(app);
const io = require('socket.io')(server);

shark0der avatar May 23 '16 19:05 shark0der

After fiddling with the cli options I found that the websockets work normally when using --no-node-timers. I noticed that the first websocket connection succeeds to send a couple of frames back and forth (<1 second) but quickly stalls, and then constantly timesout at 10s, so I'd suspect some race condition taking place.

$ npm list -g --depth 0 | grep devtool
├── [email protected]

$ npm list --depth 0 | egrep 'socket.io|express'
├── [email protected]
├── [email protected]

$ node -v
v5.11.1

$ lsb_release -ds
Ubuntu 16.04 LTS

shark0der avatar May 23 '16 20:05 shark0der