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

🚀 Feature Request: Add support for custom local hostnames

Open Hexstream opened this issue 3 years ago • 23 comments

Describe the solution

Hello,

I am managing 25+ subdomains.

Right now, if I start multiple instances of wrangler pages dev (on multiple ports), I get URLs like:

https://127.0.0.1:8788/
https://127.0.0.1:8789/
https://127.0.0.1:8790/

I would much rather use URLs like:

https://dev.www.hexstreamsoft.com:8788/
https://dev.clos-mop.hexstreamsoft.com:8789/
https://dev.notes-and-tips.hexstreamsoft.com:8790/

So for instance, I added a mapping from dev.www.hexstreamsoft.com to 127.0.0.1 in my /etc/hosts/ file.

However, after starting wrangler pages dev public --local-protocol https and successfully opening https://127.0.0.1:8788/, https://dev.www.hexstreamsoft.com:8788/ does not work:

custom-local-hostname-https.png

(Plain HTTP is irrelevant for my use-case, since all my websites are HTTPS-only with full HSTS enabled (so it's impossible to access dev.www.hexstreamsoft.com over plain HTTP anyway), and many modern features are HTTPS-only.)

So, it would be really nice if I could use something like this: wrangler pages dev public --local-protocol https --hostname dev.www.hexstreamsoft.com

Hexstream avatar Oct 08 '22 12:10 Hexstream