// use case

Expose your ASP.NET Core app on a public URL

Kestrel listens on localhost. dotnet run --urls https://localhost:7000 gives you a self-signed cert your phone won't trust. lrok's edge cert is real.
  1. Run the app

    $ dotnet run
  2. Tunnel

    $ lrok http 5000
  3. Forwarded headers middleware

    In Program.cs: app.UseForwardedHeaders(new ForwardedHeadersOptions { ForwardedHeaders = ForwardedHeaders.All }). HttpContext.Request.Scheme then reflects lrok's https.

// why lrok for this

ASP.NET's anti-forgery tokens are tied to the request scheme. With real https from lrok, dev cookies pick up the Secure attribute — same as prod.

Related workflows