mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-22 04:34:44 +00:00
Use per-cdp connection HttpClient
This commit is contained in:
@@ -39,10 +39,13 @@ pub const FetchOpts = struct {
|
||||
writer: ?*std.Io.Writer = null,
|
||||
};
|
||||
pub fn fetch(app: *App, url: [:0]const u8, opts: FetchOpts) !void {
|
||||
const http_client = try app.http.createClient(app.allocator);
|
||||
defer http_client.deinit();
|
||||
|
||||
const notification = try Notification.init(app.allocator);
|
||||
defer notification.deinit();
|
||||
|
||||
var browser = try Browser.init(app, .{});
|
||||
var browser = try Browser.init(app, .{ .http_client = http_client });
|
||||
defer browser.deinit();
|
||||
|
||||
var session = try browser.newSession(notification);
|
||||
|
||||
Reference in New Issue
Block a user