-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
feat: added clientPort to HmrOptions #3578
Conversation
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.
You may need to update the docs also https://github.com/vitejs/vite/blob/main/docs/config/index.md#serverhmr
Glad to hear! I feel bad about trampling over the previous related PRs but yes I'll update the doc, should be updated shortly. I'm new to open source Github contribution in general, I was going to try "git commit --amend" locally, I've always found a single commit per review is best in the past, but if a separate commit per feedback revision works best for the workflow I can do that as well. |
I personally like a commit history, cause this way we can observe what was made |
OK, added to the doc, as a separate commit. Not sure what the final commit message will be if you squash-merge, maybe just all the them concatenated? I'll find out when it happens. |
Not sure if that second sentence is needed, the motivation for having the option, let me know what you think. |
Woops, I wasn't doing the |
The commit message will be the title of the PR |
Description
There are times when it's useful to mismatch the HMR ports, meaning you run the websocket server on a different port than the client code looks for. The prime example is if you have SSL in front of your dev server using an SSL-terminating proxy, you'll also need to add SSL termination in front of your HMR websocket to avoid "mixed security" issues in the browser. But you can't have TLS and non TLS all on the same port.
So with this change, you'd be able let the websocket run on its default of 24678, but have the client code try to connect to ws://host:24679 for example, then use something like
stunnel
or any kind of SSL terminating proxy to route from 24679 => 24678.Additional context
Nothing in particular, it's a minor change.
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
I was unable to get the tests to run, kept getting
If you help me out there I can run them.
fixes #123
).