workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

Support local hostnames w/ TLS for `wrangler dev` remote mode

Open jed opened this issue 3 years ago • 2 comments

(submitted by request from discord)

Currently, there is no way to get wrangler remote mode to bind to a local hostname. This prevents users from testing wildcard subdomains and workers based on Cloudflare for SaaS, since there is no way to provide a TLS certificate, no way to bind to a hostname other than localhost, and no way to provide a zone not registered with Cloudflare. For example, I have a production worker that responds to subdomain wildcards on zone mydomain.com, allowing https://some-random-string.mydomain.com urls, and a development version of the worker that does the same locally, allowing https://some-random-string.mydomain.com.test urls.

This use case is well served by wrangler local mode thanks to Miniflare (along with DNSMasq and mkcert on macOS), which allows bindings to arbitrary hostnames provided, backed up by custom certificates provided in [miniflare.https] in wrangler.toml. It would be nice to see parity with this support for remote mode.

jed avatar Jul 12 '22 22:07 jed

Thanks for filing this. Off the top of my head, I'm thinking we could add a [dev.https] section in wrangler.toml, that mirrors miniflare's configuration, and adds it to remote mode.

threepointone avatar Jul 13 '22 09:07 threepointone

Assigning to @cameron-robey for exploring solutions

threepointone avatar Jul 28 '22 13:07 threepointone

FWIW: For people like me that uses Workers Sites that is also relevant. My Worker Sites uses de subdomain as key to change the entry point of the index and others things.

Wallacy avatar Sep 28 '22 22:09 Wallacy

Hi @jed! Thanks for flagging this. In an effort to remove stale issues so we can have better signal on current friction points, we’re closing out issues that have not been updated within the last 6 months. Unifying the proxies in front of remote and local mode is something we're planning to do as part of the ongoing conversion of Wrangler to a library. A byproduct of this work will be support for HTTPS in wrangler dev --remote.

mrbbot avatar Nov 15 '23 15:11 mrbbot