-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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 using vite as a proxy for another vite server #13218
Conversation
Run & review this pull request in StackBlitz Codeflow. |
9b2d08f
to
a32c182
Compare
a32c182
to
44f9370
Compare
44f9370
to
8887562
Compare
Would you explain your use case? Why is this feature needed in your setup? |
The test case that I have included in this PR is basically a very simple reproduction of what we actually do. |
/ecosystem-ci run |
📝 Ran ecosystem CI: Open
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought this is similar with vitejs/vite-plugin-vue#21. But actually this was different from that one.
I think this won't cause any issues for others. 👍
@sapphi-red @patak-dev Thank you for reviewing and merging my PR! |
Description
The goal of this PR is to allow using vite as a proxy for another vite server, with HMR still working for the upstream server.
Additional context
Currently vite prevents any websocket connection with the
vite-hmr
websocket protocol from being forwarded to another server. I think it is not correct, vite should only handle itself the connection if it has the correct URL (in addition to the correct websocket protocol), and it should be able forward websocket connections to another server whatever the protocol it uses.What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).