Replies: 10 comments
-
This is possible for us to build. I'd be curious to get your input on how we could do it:
|
Beta Was this translation helpful? Give feedback.
-
Thanks for the response!
For many of my needs (i.e. dynamically-configured webhooks for third-party services), the endpoint would have to be public. And that's perfectly fine with me, as long as that public state is both clear and optional.
I don't think it's possible to configure any major webhook-based service to also send along a cookie, so that solution wouldn't really serve my needs.
For the URL itself: randomly generating subdomains at a To avoid that ☝️ song-and-dance, though, it would also be nice to request a subdomain up-front, e.g. Let me know if there's any additional clarity I can give on this feature request (or if there's anything wrangler-side that I could help with). |
Beta Was this translation helpful? Give feedback.
-
It can get extremely complicated to expose a sub domain directly on cloudflare's end for this usecase (the localhost proxy isn't a plain proxy, it also adds headers and such, and it's going to get more advanced layers soon-ish. Further, for non-zone usecases, the workers dev sub domains are effectively random/based on a hash) So I don't think that's what we should do. It feels like exposing an external tunnel is the bullet proof way forward. What would make it better is if we use Cloudflare tunnel for this, since we can then tap into your existing account if you want to use sub domains on your own zone/site, and stable ones otherwise. Here's documentation for using tunnel with Cloudflare pages https://developers.cloudflare.com/pages/how-to/preview-with-cloudflare-tunnel but it should work with wrangler dev as well. In the future, we should integrate this directly into wrangler, so the experience is seamless. This, I think, would satisfy your usecase cleanly, does that sound right? |
Beta Was this translation helpful? Give feedback.
-
Using a tunnel solution integrated with Cloudflare makes a lot of sense. And that's very similar to what I'm doing already for My biggest concern would be that dev workloads that are already running on the edge would be forwarded to the local machine and then tunneled back out to Cloudflare network again. So it depends on what "integrate this directly into wrangler" means: if you're talking about using Cloudflare Tunnel to forward traffic from the edge network in one zone to another, that seems fine (although it would be even better if wrangler were able to, optionally, run those workloads directly in the target zone in the first place, right?). If you're talking about using Cloudflare Tunnel built into the Apologies in advance if I'm misunderstanding or getting some terms of art incorrect here. |
Beta Was this translation helpful? Give feedback.
-
+1, I also use ngrok as a workaround. It's essential not just for webhooks, but for developing embedded Shopify apps - I need to provide Shopify with a static URL in development in order to preview any changes in dev. The guide for Cloudflared + Pages almost addresses this perfectly - but needs some way to reserve a static subdomain, akin to how workers.dev already works.
...could serve requests at As an end user of wrangler, integrate cloudflared tunnels with wrangler seems like it would nicely mirror the behavior of workers.dev, where a worker gets assigned the domain
=> This would allow each person working on a workers-based project to setup their own publicly accessible static dev domain. Most apps I've worked on with webhooks or that integrate with more complex 3rd party APIs end up needing something like this. It'd be ideal to keep it out of |
Beta Was this translation helpful? Give feedback.
-
Cross-linking cloudflare/wrangler-legacy#1529, which discusses wrangler being currently broken for subdomains |
Beta Was this translation helpful? Give feedback.
-
Assigning this to myself, I want to work on this. |
Beta Was this translation helpful? Give feedback.
-
Moving this to wrangler2 repo, we'll probably tackle this in 2.X. |
Beta Was this translation helpful? Give feedback.
-
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
|
Beta Was this translation helpful? Give feedback.
-
I do this pretty much every time I set up a local dev project - would be very convenient for wrangler to expose a public url (with optional consistent naming, similar to |
Beta Was this translation helpful? Give feedback.
-
💡 Feature request
Enable public access of
wrangler dev
workloads.Describe the feature
This feature request is the opposite of cloudflare/wrangler-legacy#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 thentail
the logs or, more often, to spin up something likelocaltunnel
to use as a temporary webhooks endpoint. The first solution is much slower than I expect an equivalentwrangler dev
would be. The second solution is both cumbersome and somewhat silly conceptually, sincewrangler 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.Beta Was this translation helpful? Give feedback.
All reactions