Use per-cdp connection HttpClient

This commit is contained in:
Nikolay Govorov
2026-02-17 12:37:44 +00:00
parent fbe65cd542
commit 9296c10ca4
9 changed files with 82 additions and 50 deletions

View File

@@ -24,9 +24,9 @@ const ArenaAllocator = std.heap.ArenaAllocator;
const js = @import("js/js.zig");
const log = @import("../log.zig");
const App = @import("../App.zig");
const HttpClient = @import("../http/Client.zig");
const ArenaPool = App.ArenaPool;
const HttpClient = App.Http.Client;
const IS_DEBUG = @import("builtin").mode == .Debug;
@@ -47,6 +47,7 @@ http_client: *HttpClient,
const InitOpts = struct {
env: js.Env.InitOpts = .{},
http_client: *HttpClient,
};
pub fn init(app: *App, opts: InitOpts) !Browser {
@@ -61,7 +62,7 @@ pub fn init(app: *App, opts: InitOpts) !Browser {
.session = null,
.allocator = allocator,
.arena_pool = &app.arena_pool,
.http_client = app.http.client,
.http_client = opts.http_client,
};
}