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

Keep Getting "[WDS] Disconnected!" Error #474

Closed
Tieantono opened this issue Aug 10, 2019 · 3 comments
Closed

Keep Getting "[WDS] Disconnected!" Error #474

Tieantono opened this issue Aug 10, 2019 · 3 comments

Comments

@Tieantono
Copy link

Hi there, I have an issue when using your hot reload feature on an application that running using HTTPS, I keep getting "[WDS] Disconnected!" error. However, this problem does not occur when my application does not running using HTTP.

This is what it looks like in Google Chrome's DevTools:
image

@ryanelian
Copy link
Owner

I believe this is caused by the Webpack Dev Server (WDS) not running on the HTTPS port (https://localhost:28080), only the HTTP port (http://localhost:28080).

Honestly, this is a tricky problem to solve because enabling HTTPS would require a valid HTTPS certificate, which will cause the browser to show invalid certificate error (because localhost certificates are self-signed).

@ryanelian
Copy link
Owner

ryanelian commented Aug 14, 2019

What happens when you enable HTTPS access for WDS:

image

image

Turns out my issue was because I was running code on https and when I request something from webpack dev server it runs the socket code and uses whatever level of security is currently being used (in my case https).

^ quoted from someone with similar problem


Currently there is NO way to automatically trust a dynamically generated self-signed certificate for use in wss:// (https://stackoverflow.com/a/23036270) and we cannot downgrade connection from https:// to ws:// (https://stackoverflow.com/a/9752145)

If you really need to develop with HTTPS, use dev-watch mode instead of hot reload mode.

Feel free to send PR if you know the solution to this problem, though.

@Tieantono
Copy link
Author

I see, so we have to use HTTP instead.

Thank you for your confirmation.

I'm closing this issue since it is coming from WDS.

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

No branches or pull requests

2 participants