// use case

Expose your Flask app on a public URL

flask run defaults to 127.0.0.1:5000. Going public means setting --host=0.0.0.0 and still relying on someone else hosting your IP. lrok skips both: one command, real HTTPS, no port-forwarding.
  1. Run Flask

    $ flask run --port 5000
  2. Tunnel

    $ lrok http 5000
  3. Trust the proxy for X-Forwarded-Proto

    If your app builds URLs via url_for(_external=True), wrap with werkzeug.middleware.proxy_fix.ProxyFix(app.wsgi_app, x_proto=1, x_host=1). lrok forwards the standard X-Forwarded-* headers; ProxyFix unwraps them.

// why lrok for this

Flask's session cookies require Secure when used over HTTPS in prod. Real cert at the lrok edge means dev mirrors prod cookie behavior — bug-finding parity.

Related workflows