Hello!
Please help, i updated socket.io from 1.7.4 to new version 2.0.1 and my project not running.
NodeJS version: 6.10.2
Express version: 4.15.2
My code:
var fs = require('fs'),
httpsOptions = {
key: fs.readFileSync('privkey.pem'),
cert: fs.readFileSync('cert.pem')
},
app = require('express')(),
server = require('https').createServer(httpsOptions, app),
io = require('socket.io')(server);
server.listen(8888);
In version socket.io 1.7.4 work good, but in version socket.io 2.0.1 i get error (when running script): Segmentation fault
What is the problem?
I think this might be related to uws
. I've seen this myself.
What OS are you using?
As a workaround, try setting wsEngine
to ws
:
io = require('socket.io')(server, { wsEngine: 'ws' });
Or simply revert to socket.io 1.7.4 (npm install socket.io@1
) for now, which is what I had to do.
@brenc thank you! { wsEngine: 'ws' }
helped me!
I use OS: CentOS 7
thank so much, you save my life
{ wsEngine: 'ws' } worked for me too. Thank you!
I think it is the third time I hit this ... using all the latest packages.
Is there a chance we can get this to be fixed by default? ...
Most helpful comment
I think this might be related to
uws
. I've seen this myself.What OS are you using?
As a workaround, try setting
wsEngine
tows
:Or simply revert to socket.io 1.7.4 (
npm install socket.io@1
) for now, which is what I had to do.