devtool
devtool copied to clipboard
Websocket server with devtool will auto disconnect
When I use devtool, my websocket server will auto disconnect to client.
if I use node app.js, it will be right.
i am using devtool with my websocket server and have no trouble i am running it with:
devtool app.js --watch --break
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);
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