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
Passing options to tiny-lr (live reload) for HTTPS support #4249
Conversation
Nice. Can you add a test? |
Hah, i was going to submit the same PR. Do you think that live reload should have an option for its own key and cert and then default to options.sslKey, options.sslCert if they aren't set? Or does that not really matter? |
@jrjohnson this is mostly for dev. environments where the certs are for the most part invalid but on the same domain as the app so having a different cert for LR would make it hard for dev's to accept the exception and to make it work in the browser. @stefanpenner working on the tests. |
ah, i had setup my own local CA for dev, so all my certs are valid. I'm personally happy with this PR as is. :) |
@@ -47,7 +57,7 @@ module.exports = Task.extend({ | |||
this.expressServer.on('restart', this.didRestart.bind(this)); | |||
|
|||
// Start LiveReload server | |||
return this.listen(options.liveReloadPort) | |||
return this.listen(options) | |||
.then(this.writeBanner.bind(this, options.liveReloadPort)) | |||
.catch(this.writeErrorBanner.bind(this, options.liveReloadPort)); |
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.
should we show that live reload is using ssl in the banner?
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.
also yes
@dosco Can you squash your commits? Otherwise looks good to me. |
server.listen(port, resolve); | ||
}); | ||
server.listen(options.liveReloadPort, resolve); | ||
}.bind(this)); |
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.
i don't see where this
is used inside this function (maybe I'm reading the diff wrong)
left a comment, otherwise (including @chadhietala comment) LGTM |
I don't think Windows failures are related. Restarting for good measure. Also Coveralls has interesting opinions on math. |
Needs rebase but Lgtm |
@dosco Can you rebase? |
two more comments |
Passing options to tiny-lr (live reload) for HTTPS support
Ember CLI is currently creating an instance of tiny-lr server without passing an options object which causes the live reload to always start to HTTP mode, with the newly added HTTPS support in express-server we an now pass the key and cert to tiny-lr allowing it to also launch in HTTPS mode.
Currently when ember serve is launched in HTTPS mode live reload will not work due to mixed-content issues in the browser.