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 hmr proxy #417

Merged
merged 2 commits into from
Jun 3, 2020
Merged

Conversation

germanftorres
Copy link
Contributor

Hi,

This commit fixes #414 by filtering the websockets upgrade requests that the hmr module will handle. Only the upgrade requests originating from the hmr.js will be processed. Uses custom header Sec-WebSocket-Protocol : snowpack-hmr to do the filtering.

@stramel
Copy link
Contributor

stramel commented Jun 3, 2020

This seems like a reasonable fix to me

@FredKSchott
Copy link
Owner

Awesome! glad this was so easily supported in the native WS client

@FredKSchott FredKSchott merged commit 54c982f into FredKSchott:master Jun 3, 2020
@FredKSchott
Copy link
Owner

ported to esm-hmr as well

@germanftorres
Copy link
Contributor Author

germanftorres commented Jun 3, 2020

Great @FredKSchott . Don't forget to update assets/hmr.js to send esm-hmr also.

@FredKSchott
Copy link
Owner

doh! thanks for catching

@germanftorres germanftorres deleted the fix-hmr-proxy branch June 3, 2020 23:47
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.

Hmr and proxy interfere when proxying websockets requests
4 participants