Giter Site home page Giter Site logo

Comments (8)

airhorns avatar airhorns commented on July 24, 2024

Are you hoping to do something differently with the request if it is a websocket upgrade request, or really just log something differently?

from fastify-websocket.

a-a-GiTHuB-a-a avatar a-a-GiTHuB-a-a commented on July 24, 2024

Actually both! See, when I open a websocket, it throws an INSANE amount of logs, almost one every .1 seconds!
If I fix this issue, I'm really just hoping to log it differently, but right now it's crucial as the websocket never connects and I can't find out why.
I have a link if there's some other way to debug this thing.

from fastify-websocket.

Eomm avatar Eomm commented on July 24, 2024

Are you using a react app?
I face a similar issue when one component was connecting to the WebSocket at every component render.

from fastify-websocket.

a-a-GiTHuB-a-a avatar a-a-GiTHuB-a-a commented on July 24, 2024

No, it's not React.
Do you want the link?

from fastify-websocket.

airhorns avatar airhorns commented on July 24, 2024

I think it should be pretty easy to add something like this! Would you like to submit a PR? I would suggest adding an onRequest hook that checks if the request.raw[kWs] is present and sets a nice boolean property that you can then inspect in the route handler. I am not certain that'd work, it might have to be a preValidation hook, but there's definitely enough information to know if the request is upgraded yet or not.

from fastify-websocket.

a-a-GiTHuB-a-a avatar a-a-GiTHuB-a-a commented on July 24, 2024

Does it work with both the websocket: true and the wsHandler cases?

from fastify-websocket.

airhorns avatar airhorns commented on July 24, 2024

Not sure -- shouldn't be too hard to write a test for though!

from fastify-websocket.

climba03003 avatar climba03003 commented on July 24, 2024

Closed by #163

from fastify-websocket.

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.