Git Product home page Git Product logo

Comments (2)

kettanaito avatar kettanaito commented on June 2, 2024 1

Hey, @JohnPhamous.

I highly recommend using MSW for request interception in both browser and Node.js. MSW uses Service Worker API that intercepts requests regardless of the request client in the browser, so that would be an ideal solution for your monitoring tool.

The "interceptors" library is a backbone for the Node.js support in MSW and although it can be used standalone, MSW provides a much better experience in a browser due to the usage of the Service Worker.

You can follow this step-by-step tutorial to set up the requests interception in the browser.


That being said, the "body stream already read" issue does seem related to #113. It looks like we need to clone the response before reading its body. Please, would you be interested in providing a pull request to fix that?

Other network requests that are not using XHR are not being intercepted (should they?).

What kind of network requests are you referring to? Can you give an example?

Overall, the in-browser interception in this library is achieved by request client stubbing and concerns only the requests made via window.fetch or XMLHttpRequest.

from interceptors.

kettanaito avatar kettanaito commented on June 2, 2024

Should be fixed in #152. Please try this out in the next release.

from interceptors.

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.