Use YARP to intercept all outbound requests of an app for testing purposes #2974
-
|
Hi, I created an Aspire web app with its API project calling external resources (e.g. www.github.com). Can I achieve this with YARP? Any other alternatives otherwise? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
No, YARP is an L7 HTTP proxy. What are you trying to do with the intercepted requests? You'd have to intercept connections yourself (e.g. setting a proxy, redirecting the connection with the help of the OS, MITM software, etc.). And even if you do, you'd have to deal with how to process proxy requests or how to present the correct certs yourself. |
Beta Was this translation helpful? Give feedback.
No, YARP is an L7 HTTP proxy.
If you want to hijack outgoing traffic for your process, this isn't something YARP can do for you out of the box.
What are you trying to do with the intercepted requests?
You'd have to intercept connections yourself (e.g. setting a proxy, redirecting the connection with the help of the OS, MITM software, etc.).
The easiest option is likely to set environment variable that instruct your applications to use a forward HTTP proxy, and point those requests at your server.
And even if you do, you'd have to deal with how to process proxy requests or how to present the correct certs yourself.
While technically possible (you can look at https://github.com/MihaZupan/Mi…