You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched existing issues to ensure the feature has not already been requested
馃殌 Feature Proposal
It would be nice to allow for dynamic upstreams when forwarding on websocket upgraded requests much in the same way that you can specify a getUpstream function to your replyOptions to pass some logic to determine an http upstream. However, leaving the wsUpstream property as an empty string results in the following error:
Error: upstream must be specified
It would be nice if this could be avoided when a getUpstream is supplied for an empty wsUpstream option.
Motivation
No response
Example
For example, it would be nice to register a websocket proxying mechanism like so
fastify.register(require('@fastify/http-proxy'), {
websocket: true,
wsUpstream: '',
replyOptions: {
getUpstream: function (req) {
// some logic to determine the wsUpstream
}
}
})
The text was updated successfully, but these errors were encountered:
Sorry for the silence. After further review, it appears that this functionality does work with dynamic websocket proxying endpoints but only for the upstream option and not the wsUpstream. I'm happy to create a PR for allowing dynamic endpoints using the similar pattern of an empty upstream for an empty wsUpstream for perhaps more clarity of usage.
I'm also, personally, okay with this being closed since there is a workaround.
Prerequisites
馃殌 Feature Proposal
It would be nice to allow for dynamic upstreams when forwarding on websocket upgraded requests much in the same way that you can specify a
getUpstream
function to yourreplyOptions
to pass some logic to determine an http upstream. However, leaving thewsUpstream
property as an empty string results in the following error:It would be nice if this could be avoided when a
getUpstream
is supplied for an emptywsUpstream
option.Motivation
No response
Example
For example, it would be nice to register a websocket proxying mechanism like so
The text was updated successfully, but these errors were encountered: