// use case

Expose your Flask dev server to Twilio for Twilio webhooks

Twilio posts to your URL every time an SMS arrives at your number. Without a tunnel, you can't test SMS-driven flows locally — every change means deploying. Flask (Python) dev server.
  1. Reserve a stable subdomain

    On the lrok free plan you keep one reserved subdomain forever. Pick a name your Twilio dashboard can hold onto — webhook URLs that survive laptop restarts mean fewer dashboard re-pastes.

    $ lrok reserve fla-twilio
      Reserved https://fla-twilio.lrok.io
  2. Run your Flask app

    Start the dev server on port 5000 (the Flask default).

    $ flask run
  3. Tunnel localhost to the public URL

    lrok forwards https://fla-twilio.lrok.io/webhook → http://127.0.0.1:5000/webhook. The flag --hint binds your reserved subdomain to this tunnel.

    $ lrok http 5000 --hint fla-twilio
      Forwarding https://fla-twilio.lrok.io  ->  http://127.0.0.1:5000
  4. Paste the URL into Twilio

    Phone Numbers → Active Numbers → Messaging webhook. Paste https://fla-twilio.lrok.io/webhook as the destination.

  5. Watch deliveries land in the request inspector

    Every webhook Twilio sends shows up at lrok.io/dashboard with full body, headers, status, and latency. Re-deliver any request to your Flask handler with one click. Twilio expects a TwiML response (XML). Return Content-Type: application/xml with <Response><Message>...</Message></Response>. The inspector shows what Twilio actually parsed.

// why lrok for this

lrok's reserved subdomain is free and lives forever, so your Twilio twilio webhooks URL never rotates. $9/mo flat for unlimited tunnels — no SSO tax, no enterprise-only signature verification, no bandwidth metering. The request inspector is built in.

Related workflows