HenningM / express-ws

WebSocket endpoints for express applications
BSD 2-Clause "Simplified" License
877 stars 142 forks source link

Getting error with simple config on existing Express4 app #59

Open jrgleason opened 7 years ago

jrgleason commented 7 years ago

I have an express4 app and I add the following to my app...

require('express-ws')(app);
app.ws('/ws', function(ws, req) {
  ws.on('message', function(msg) {
    ws.send(msg);
  });
});

Then I run the app. However, when I try to connect to the websocket I get the following...


    at ServerResponse.OutgoingMessage._send (_http_outgoing.js:138:38)```
joepie91 commented 7 years ago

Your stacktrace seems to be incomplete. Can you provide the full error message and stack trace, as well as the Node.js version that you're experiencing this issue on?