← Back to Forum
0
Getting Started
LocaltoNet for webhook testing with a simple request logger
I kept losing time trying to debug webhook issues from inside the app, especially when the sender just says "delivery failed" and gives basically no detail. What helped a lot was putting a super small local endpoint in front first, just to log the full request, then exposing that through LocaltoNet and forwarding to the real app after.
Being able to inspect headers, payload shape, signatures, and retry behavior separately made the whole flow much easier to reason about. Curious what other people use for this, is there a lightweight setup you like better for incoming request inspection?
Comments (4)
Yep, splitting the capture step from the app logic is such a clutch move. I started doing something similar mostly so I could compare first delivery vs retries side by side, some providers tweak tiny stuff between attempts and it can completely throw you off.
Do you keep the forwarder stateless, or do you let it replay saved requests too?
Keep the forwarder dumb, but absolutely save the raw request to disk so you can replay it with a tiny script later. That's been the sweet spot for me, the proxy stays boring and reliable, and when a payment provider sends some cursed edge-case payload at 2am I can rerun that exact input against whatever branch I'm testing without re-triggering anything upstream.
Save the exact raw bytes plus the request path before anything parses it, otherwise the one webhook you actually care about will fail signature verification only in your "helpful" logger and you'll get to enjoy that little circus. Learned that the annoying way with Stripe, text logs looked fine but the body had been normalized just enough to break HMAC checks.
Yep, raw bytes before any middleware is the bit I was missing, that's exactly where mine went sideways. I had the logger reading the body too early and the provider signature started failing even though the payload looked identical in the logs, once I changed it to buffer and pass through untouched it got a lot saner. Did you end up storing the headers and body together as one blob too, or just the body bytes and path?
Please log in to post a comment.