GithubHelp home page GithubHelp logo

Unhandled 'error' event about engine.io HOT 8 CLOSED

mmastrac avatar mmastrac commented on August 17, 2024
Unhandled 'error' event

from engine.io.

Comments (8)

nicokaiser avatar nicokaiser commented on August 17, 2024

The "reserved fields must be empty" message is emitted by ws when a client sends invalid WebSocket data. We experience this to happen quite often, don't know if the reverse proxy or broken clients (or both) are the culprit.

So this error is very common in real life environments (and thus not an error rather a "invalid client request") so it should not kill the whole server.

Do you have an 'error' handler for your socket objects? Like this:

server.on('connection', function (socket) {
  socket.on('message', function () { ... });
  socket.on('close', function () { ... });
  socket.on('error', function (err) {
    debug('socket error: ', err); // or just do nothing
  });
});

from engine.io.

mmastrac avatar mmastrac commented on August 17, 2024

Unfortunately that doesn't fix things - the error is an unhandled event emitted from the transport. I could try adding an error handler to the transport to patch around this, but I think there is a bug underlying this.

from engine.io.

rauchg avatar rauchg commented on August 17, 2024

@mmastrac I see what you mean now. error must be firing twice on the transport right?

from engine.io.

mmastrac avatar mmastrac commented on August 17, 2024

@guille Correct - and it throws an unhandled exception the second time.

from engine.io.

rauchg avatar rauchg commented on August 17, 2024

Yep because we detach the error event.

from engine.io.

rauchg avatar rauchg commented on August 17, 2024

So this is an easy fix

from engine.io.

mmastrac avatar mmastrac commented on August 17, 2024

Great- if you have a suggested patch, I can test it out with our load test. Thanks!

from engine.io.

rauchg avatar rauchg commented on August 17, 2024

Please test with master

from engine.io.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.