Lightpanda browser now uses libcurl

Pierre Tachoire
CTO

Thanks to #922 , we’ve switched all Lightpanda browser HTTP requests from our home made Zig HTTP client + zig.tls to libcurl .
The HTTP client is a crucial part of any browser engine.
Over the past two years, we’ve experimented a lot, starting with the Zig standard library, then building our own custom client. The main goal was always the same: handle both synchronous and asynchronous requests using non-blocking io.
Our in-house solution worked, but it came with trade-offs. Every new feature or bug fix meant increasingly complex code maintenance. We were spending more time wrestling with the client than building the browser itself.
Why now
Our next big feature will be the implementation of CDP request interception .
In short, request interception lets the browser pause any HTTP request and ask the client what to do: allow, block, modify, or mock any request. It’s a core feature for advanced CDP clients who need to filter, track, log, or inject cached data.
Implementing this properly required a big change to our HTTP client. Some requests need to pause without blocking others that are already in flight. In our previous setup, all initial fetches were synchronous, which made this impossible.
Instead of trying to adapt our custom client to handle this, we switched to libcurl. This allows us to implement parallelization for the initial fetch of the document. Even if we had to execute JS in sequential order, we are now loading the resources at the same time, accelerating a real web page loading and offering a way to pause requests and implement request interceptions.
What this means for developers
Switching to libcurl comes with a bunch of benefits that make life easier for anyone building on Lightpanda:
- Better TLS support: we now use mbedTLS, which fixes tricky TLS issues on some websites
- HTTP/2 support: modern web requests run faster than ever
- Proxy support: works smoothly with both plain and secure HTTP proxies
- Detailed debug output: dumping request details is now much easier
In short, libcurl gives us a more solid, flexible foundation, letting us focus on speed, request interception, and all the exciting features coming next.