-
Notifications
You must be signed in to change notification settings - Fork 521
bug(dev-webserver): Allow HTTPS from Startup.cs #272
Conversation
Unfortunately it's not this simple. Apart from not compiling (can't assign to There's no straightforward way to have the Webpack dev middleware expose an HTTPS endpoint, because it would need a cert for Ideally we'd bypass this problem altogether by reverse-proxying the HMR requests from ASP.NET (independently of whether you connect to it via HTTP or HTTPS) into Node. I'll look into this. |
I think you're right, for some reason it worked for me (but then again I might already have a spoof-cert setup for my localhost, didn't even think about that). |
IMO, if changes on Kestrel do not materialize, It may be easier to just let the developer deal with the self-certificate instalation. A minimal documentation would be a good starting point. A dev who already has Kestrel on HTTPS should have already worked out how to make the self-cert and so. |
@gerardog What are the changes you would like from Kestrel? |
Sorry If I expressed myself poorly. What I understood is that this PR is an intent to fix #271 by making webpack-dev-server run on https. That would be fine by me even if I have to fight a little bit to configure the certificates. Instead, #271 was fixed with another approach: a reverse-proxy. It is probably a better solution but it did not work and was rolled back because Kestrel throws So, I was wondering if we could support webpack-dev-server on https in the meantime. Just my opinion. |
@halter73 What we need to fix #271 is for Kestrel not to throw the The @gerardog Until 1.1.0 ships, you could use this technique to bypass the problem. It's not ideal but is the best I can suggest in the short term. |
Thanks Steve. It works. There is even a easier way to allow mixed content in Chrome: In the address bar at the right end should be a 'shield' icon, you can click on that to run insecure content. |
Fixes #271
If someone uses
https
to spin up Kestrel, Webpack-dev-server is static & set tohttp
. Added option to WebDevMiddlewareOptions toUseHttps
to enable HMR when they're using/testing https.