Expose public URLs for wrangler dev
See original GitHub issueš” Feature request
Enable public access of wrangler dev
workloads.
Describe the feature
This feature request is the opposite of cloudflare/wrangler#1820 (and any other ārun workers locallyā requests): I love that wrangler dev
runs workloads on edge servers, but itās unclear if accessing those workloads publicly is possible. Being able to use those workers at an auto-generated, public URL would be ideal.
The specific use-case: most/all of my development work is not done locally, so exposing dev
workloads on localhost is incompatible with the way I work across distributed services in the cloud and across providers. Even more specifically, Iād really like to be able to more easily work on workers that are themselves webhook endpoints for other services (like e.g. Stripe).
Describe the alternatives
My current workaround is to either publish
the thing to a specific subdomain and then tail
the logs or, more often, to spin up something like localtunnel
to use as a temporary webhooks endpoint. The first solution is much slower than I expect an equivalent wrangler dev
would be. The second solution is both cumbersome and somewhat silly conceptually, since wrangler dev
is already tunneling from the edge to localhost and my tunnel is sending that data right back into the public realm through yet-another-network.
Skipping that extra hop altogether and enabling publicly-accessible workloads during dev
would improve my Workers workflow considerably!
Itās also entirely possible that Iām mis-reading the documentation. If itās already possible to access dev
workloads publicly, then consider this a feature request for updated and clarified docs.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:9 (5 by maintainers)
Top GitHub Comments
Assigning this to myself, I want to work on this.
A solution in the meantime for anyone whoās looking for one is to use Cloudflare Tunnel. Thereās somewhat of a roundabout way to use a dashboard-managed Tunnel that can be activated on demand. Hereās instructions (make sure you install
cloudflared
first):cloudflared tunnel create NAME
on your local device that you are testing on. If you skip this step and create a Tunnel via the dash you cannot activate on-demand (itās always on), so make sure you create it this way. Pick a name and substituteNAME
for your Tunnel name.laptop.example.com
->http://localhost:3000/
)cloudflare tunnel run NAME
on your local device. Note that when this command is not running your Tunnel will not work: this helps protect against accidently leaving your Tunnel running and exposing a service by mistake.