webpack-rails icon indicating copy to clipboard operation
webpack-rails copied to clipboard

Add HTTPS option specific for manifest load

Open naganowl opened this issue 8 years ago • 4 comments

Similar to the other manifest options (host + port), we should be able to specify the protocol for serving the manifest file. This is helpful for allowing the server be proxied via HTTPS but still run the dev server via HTTP.

naganowl avatar Jul 20 '16 23:07 naganowl

Something to consider as well: it seems the assets will most likely need to be served in whichever protocol the rails serves its own assets -- which means the manifest needs to be served on the same protocol. However, assets can be proxied between HTTPS <-> HTTP via, say, nginx.

In the current state of webpack-rails, the assets protocol and manifest protocol needs to be specified because the assets view helper always returns the full url (with the protocol). However, if that can be configured (since a protocol-less url will inherit the container protocol (hopefully?)), then having different specified protocols is not needed. The webpack dev server can run in HTTP: the assets will inherit HTTPS from the container but that request is proxied to HTTP, and the manifest file can be served regularly as HTTP.

Unfortunately, I haven't really tested this idea yet. Might also fork and see if it can play out well (though currently using this fork).

juanca avatar Jul 22 '16 17:07 juanca

Can we get some input on these changes?

Being able to specify a different protocol makes sense to our application. The rails server does not need HTTPS but our clients (browsers) do need HTTPS.

We're also happy to keep our fork but I think it'll be benificial for others.

juanca avatar Oct 27 '16 18:10 juanca

I'm struggling to understand the requirement here, along with the other pull requests regarding HTTPS - what is your use case that https is a development (rather than production) requirement?

mipearson avatar Oct 28 '16 06:10 mipearson

Our rails application runs in HTTPS for development and production (and it is something that will most likely not change in the near future). This allows our development environment to mimic production.

juanca avatar Oct 28 '16 18:10 juanca