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 dx serve proxying of websocket connections established from the browser #3895

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

arvidfm
Copy link

@arvidfm arvidfm commented Mar 20, 2025

This PR makes the following changes:

  • Check for the Upgrade header to detect websocket connections where the URI doesn't include the scheme
  • Replace redirect with explicit proxying of websocket connections

The explicit proxying is required as browsers (at least Firefox and Chrome) don't handle redirect responses. E.g. Chrome emits an error complaining about an invalid response.

This PR is somewhat of a proof of concept in its current state. I'm happy to make any necessary changes to conform to Dioxus's code style and general guidelines, and to discuss alternative approaches.

Fixes #3894

@arvidfm arvidfm requested a review from a team as a code owner March 20, 2025 23:58
@ealmloff ealmloff added bug Something isn't working cli Related to the dioxus-cli program labels Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli Related to the dioxus-cli program
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't establish websocket connection between browser and server when using dx serve
2 participants