blog post on using a cloudflare worker to xdebug a live hit locally#609
blog post on using a cloudflare worker to xdebug a live hit locally#609
Conversation
|
🌐 Fork Preview for PR #609 https://pr-609.ddev-com-fork-previews.pages.dev This preview updates automatically when you push changes to your fork. |
|
Yay! |
|
|
I did that for my own use case, the stable domain, I didn't want to overcomplicate the blog post... there is one thing that that I also did which was to add the live domain as a fqdn to ddev so everything internal to drupal was as it the host were the live one too:
Might add this though. |
|
I had to run ddev non-interactively, so that it doesn't prompt me to update /etc/hosts with the fqdn to localhost, which obviously I didn't want that to happen |
|
Other than that any other feedback? Would you publish it as is? |
Interesting problem. DDEV tries to add to hosts file when the domain can't be looked up, or when it doesn't evaluate to 127.0.0.1. I thought that when I tested this earlier I didn't see problems like this.
I want to walk through and manually test. I'm sure @stasadev will have some input as well. I would like a better title. "Using Cloudflare Workers to tunnel matching traffic into your local" doesn't mention DDEV and doesn't really say what the goal is. I think the goal is using Xdebug to debug an internet-exposed service that happens to be your local DDEV project. IMO the stable subdomain would simplify this article, rather than making it more complex, because right now you have to go figure out what domain you're auto-assigned and fiddle with things. Maybe that happens anyway, not sure. I'm also not sure why you have to do any of the cloudflare worker stuff if you have |
Even with this, the share would be a tunnel, I can't tunnel to a domain that's already pointing somewhere else. The worker also has logic to only tunnel very specific traffic. |
Yes, I found it odd and wondered if there was a setting to avoid this. I looked at the code and that's where I noticed this wouldn't happen if called non-interactively. |
|
And is not just publishing a live domain, is actually hijacking the live domain. Say that you want to debug something hitting |
I would normally debug it on |
|
but that's the thing with the article, saml was hitting I was looking to debug a hit in the |
This is my first attempt at a blog post, not sure if it's useful, interesting or even well written, but gave this a try.
It is AI assisted
Rendered at https://pr-609.ddev-com-fork-previews.pages.dev/blog/cloudflare-workers-live-requests-on-your-local/