Socket.io: Socket 2.0.1 and NodeJS 6.10.2 error Segmentation fault

Created on 17 May 2017  路  5Comments  路  Source: socketio/socket.io

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?

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 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.

All 5 comments

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? ...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kootoopas picture kootoopas  路  4Comments

dmuth picture dmuth  路  3Comments

MyMomSaysIAmSpecial picture MyMomSaysIAmSpecial  路  4Comments

MichaelJCole picture MichaelJCole  路  3Comments

varHarrie picture varHarrie  路  3Comments