Skip to content
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.

Force client side HMR inference for out-of-the-box HTTPS support #74

Merged
merged 3 commits into from
Oct 15, 2020

Conversation

TobbenTM
Copy link
Contributor

@TobbenTM TobbenTM commented Oct 13, 2020

The current implementation to achieve HTTPS is far from ideal, and this PR will do what is more aligned with how the other SPA proxies work, namely force the client webpack script to use this SPA proxy to also proxy HMR websocket connections.

image

As seen above, this is how it currently works; since the HMR endpoint is hard-coded to point to the Vue CLI server, it doesn't use the correct protocol.

With this PR we force the browser to use the current host as HMR endpoint, and just pass the websockets through the same proxy we use for other requests.
This lets us skip setting up Vue CLI with certificates, just try out the sample, it is now using HTTPS by default.

I'd wish we had a better way to force this inference than the magical environment variable, there is a fairly old issue for Vue CLI here: vuejs/vue-cli#3620

@TobbenTM TobbenTM changed the title Force client side HMR inference Force client side HMR inference for out-of-the-box HTTPS support Oct 13, 2020
@bryandam
Copy link

FWIW: I tested the VueCliSample project from this PR and confirmed it worked. I also incorporated it into my project to resolve HMR Reload. (Issue #72). Great work @TobbenTM!

@EEParker EEParker merged commit 5b2589c into EEParker:master Oct 15, 2020
@EEParker
Copy link
Owner

Thank you for the PR!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants