Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow for getUpstream flow for empty wsUpstream option #351

Merged
merged 3 commits into from
Jun 12, 2024

Conversation

jcbain
Copy link
Contributor

@jcbain jcbain commented Jun 11, 2024

Resolves #333

This fix makes using wsUpstream: '' with a set replyOptions.getUpstream consistent with the established flow of using upstream: '' with a getUpstream set. To do so, just some added logic to the plugin initialization phase as well as updating the WebsocketProxy constructor logic. Note, I maintained the need for the websocket flag needing to be set to true to remain consistent with the proxying of websockets currently.

This should also allow for dynamically setting a websocket upstream through the use of the websocket options provided, which should be a bit more clear for those wanting that behavior.

Checklist

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina mcollina merged commit 27197c9 into fastify:master Jun 12, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow for dynamic websocket upstreams with replyOptions.getUpstream
2 participants