Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

[dev] HTTPS support #1204

Closed
phanect opened this issue Apr 10, 2020 · 4 comments · Fixed by #1485
Closed

[dev] HTTPS support #1204

phanect opened this issue Apr 10, 2020 · 4 comments · Fixed by #1485
Labels
dev `wrangler dev`
Milestone

Comments

@phanect
Copy link

phanect commented Apr 10, 2020

💡 Feature request

Overview and problem statement

It would be very nice if wrangler dev server allows HTTPS access. I think the self-signed certificate is enough.

I maintain Cloudflare Workers to redirect to HTTPS URL on HTTP access on specific pages.
(The website I'm involved is a bit large and I cannot configure that with Page Rules since you can create only 100 Page Rules available.)

I tried to test HTTPS redirection with wrangler dev, but as expected, I opened "http://localhost:8787", then the Worker redirected to "https://localhost:8787" and the error page is shown.

@EverlastingBugstopper #1047

@ashleymichal ashleymichal added this to the wrangler dev milestone Apr 28, 2020
@EverlastingBugstopper
Copy link
Contributor

for wrangler dev, we need a way for users to test http vs https. right now localhost server we spin up is always http, and will send https requests upstream to the worker, but that can be confusing behavior ofc. ideally, i'd send the request w/the same protocol that was sent to localhost, but there's the issue of certificates for https localhost.

i found this tool that might be helpful for us to use https://crates.io/crates/certainly

it also looks like webpack-dev-server defaults to http, but will use http with a self-signed cert it provides if you want. https://webpack.js.org/configuration/dev-server/#devserverhttps

@EverlastingBugstopper EverlastingBugstopper added the dev `wrangler dev` label Jul 16, 2020
@EverlastingBugstopper EverlastingBugstopper removed this from the wrangler dev milestone Jul 16, 2020
@EverlastingBugstopper
Copy link
Contributor

i think the way forward here is

do https by default, serve wrangler dev locally over https and upstream requests to https, then add an --http flag that is only compatible with bring your own domain configurations that will listen over http and upstream to http

@bangank36
Copy link

wrangler dev --local-protocol https

Works great! Thanks for sharing!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dev `wrangler dev`
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@phanect @ashleymichal @EverlastingBugstopper @bangank36 and others