Skip to content

Provide possibility to influence proxy options during req processing #1123

@oklemenz2

Description

@oklemenz2

Describe the feature you'd love to see

Currently for example the http(s) agent can only be set statically when instantiating the http proxy middleware.
In some situations the options need to be influenced dynamically for each request processing in httpProxy.

Therefore, it would be good to have a possibility adjust the newProxyOptions before they are passed on to httpProxy. Currently the function prepareProxyRequest is private, so there seems to be no official way to do this.

Solution: Allow to pass a callback hook in options, to adjust newProxyOptions, e.g. setting the http(s) agent before the options are passed on to this.proxy.web

Additional context (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions