// twilio integration
Twilio webhook + SMS callback to your localhost
Twilio's incoming SMS / voice / WhatsApp webhooks need a public HTTPS URL. Your handler is on localhost. lrok bridges the two without you setting up a Twilio Functions environment.
1 · Set up the lrok tunnel
1. Reserve
$ lrok reserve twilio-dev2. Run handler
$ python -m flask run --port 50003. Tunnel
$ lrok http 5000 --hint twilio-dev
2 · Configure Twilio
1. Twilio Console → Phone Numbers → your number → Messaging
A message comes in: paste https://twilio-dev.lrok.io/sms — set HTTP method to POST.
2. Voice (optional)
A call comes in: https://twilio-dev.lrok.io/voice. TwiML response.
// twilio-specific gotcha
Twilio signs requests with X-Twilio-Signature, computed over the URL + sorted form-encoded body. If your framework reorders the form fields before reaching the verification, the signature won't match. Validate against the literal request URL, including query string, in lowercase.