-
-
Notifications
You must be signed in to change notification settings - Fork 27k
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
[WDS] Disconnected! with option set to HTTPS #574
Comments
@dceddia Can I ask you to investigate this? |
@gaearon Taking a look... I can reproduce it locally against 0.4.1. However, I don't see this error with 0.3.0-alpha (which is where I originally tried out this HTTPS feature and used it successfully for a couple weeks). Maybe something changed with the how socket connection works? Edit: The difference has something to do with how that URL is determined. On the (old) version that worked, the url has the port specified, e.g. Maybe it's a webpack change - the broken one is running Edit 2: Confirmed that it works with 1.14.1 but doesn't work with 1.15.1. Looking into why... |
It looks like it has something to do with how the https://github.com/webpack/webpack-dev-server/blob/v1.15.1/client/index.js#L62 protocol: (window.location.protocol === "https:" || urlParts.hostname === '0.0.0.0') ? window.location.protocol : urlParts.protocol, In v1.14.1: https://github.com/webpack/webpack-dev-server/blob/v1.14.1/client/index.js#L62 protocol: urlParts.protocol, Changing that one line to the old @gaearon Sorry for letting this slip through. Would you like me to file an issue with |
Please file an issue with WDS. We can release a path that rolls our version of it back if this takes time to fix. |
Per my comment on #263 (sorry for misposting that), I've fixed this locally by changing this line in config/webpack.config.dev.js: Based on my understanding of the WDS code, this will configure the client to use the current window's protocol, hostname, and port. A point of interest is that I was not seeing the initial connection going through at all until I made this change. Though, afterwords, everything is working correctly. EDIT: To clarify, by "fixed locally" I modified the config file without ejecting first. Not good practice, but I was just trying to see if I could fix it. |
Nice, that fixes it for me too. I was worried that it might break hostnames other than localhost, so I tried giving my machine an alias of I could make a PR if we want to get the fix in though, thoughts? |
It was 0.0.0.0 at some point but I changed it because something else broke. I don't recall what though. |
It looks like Webpack won't get this fix until v2 unfortunately, so maybe On Tuesday, September 6, 2016, Dan Abramov notifications@github.com wrote:
|
@dceddia Send a PR please? |
Hi, webpack-dev-server maintainer here. Reverting to 1.14.1 would probably cause other issues to come up again (e.g. #134), so would probably not be worth it. I've changed my mind about this a bit, since I don't know when v2 will get stable, and this seems to be a blocking issue for some people. If someone wants to backport the fix to v1, I'll merge the PR and release a new version. Don't have time to do it myself currently. PS: also said this in the ticket mentioned above, but saying it here for visibility 😄. |
I just released |
Awesome, thanks @SpaceK33z. I just tried it out - it seems to fix this issue :) @gaearon I created a PR to bump the dependency up to 1.15.2. |
This should be fixed in 0.4.2. |
Yes it works! Good job. |
I am using the new HTTPS option to test locally from https browser to https server.
the comunication between client and server works but i get an error in the browser console>
abstract-xhr.js:132 GET https://localhost/sockjs-node/info?t=1472999253306 net::ERR_CONNECTION_REFUSEDAbstractXHRObject._start @ abstract-xhr.js:132(anonymous function) @ abstract-xhr.js:21
client:70 [WDS] Disconnected!sock.onclose @ client:70EventTarget.dispatchEvent @ eventtarget.js:51(anonymous function) @ main.js:356
HMR not working.
The text was updated successfully, but these errors were encountered: