mswjs / interceptors

Low-level network interception library.
https://npm.im/@mswjs/interceptors
MIT License
535 stars 120 forks source link

Support HTTP2 #485

Closed lox closed 9 months ago

lox commented 9 months ago

I'm trying to record/replay requests to Google Cloud APIs, specifically SecretsManager, which apprears to be grpc which is over http2.

Should http2 be working with this library?

kettanaito commented 9 months ago

Hey, @lox.

No, Interceptors don't support the node:http2 module right now. I gave the docs a quick look and it seems that client/server communication is dramatically different from node:http so our existing interceptors simply won't work.

You can give it a try and help us implement that support though, if you have enough insight into HTTP2 internals in Node.js. It's not on the roadmap otherwise.

lox commented 9 months ago

No problems @kettanaito, perhaps one day I will, not familiar enough with the internals of http2 right now either.

kettanaito commented 9 months ago

@lox, let me know if you come to that. We can brainstorm the implementation together.