Support event hooks for `devProxy` options
Forwarded from downstream issue:
|
Describe the feature
The current devProxy can only set parameters of the ServerOptions type. I want to add some additional operations to the request header in Listening for proxy events. How can I achieve this?
Additional information
- [ ] Would you be willing to help implement this feature?
- [ ] Could this feature be implemented as a module?
Final checks
- [X] Read the contribution guide.
- [X] Check existing discussions and issues.
Perhaps we could support registering proxies on nitroApp so they can be interacted with. wdyt @pi0?
dev proxy is outside of the app and in (build space) dev server. We could directly support callback functions for it however or a hook.
+1 to this feature request. I've just struggled into a need of specifying proxyReq callback in order to forward cookies to the new destination while using followRedirects: true and it seems like there are no other ways to do this rather than via this potential feature.
+1
I'm getting issues where specific, Nuxt-/Nitro-proxied requests return a 500 whereas non-proxied requests to the same endpoint do not. These seem impossible to debug / resolve without being able to inspect / alter the request before it is sent. Right now the request event happens after the request is sent, so I would like this.