Skip to content

Lightpanda: the headless browser designed for AI and automation

http: tweak http timeouts

Karl Seguinec61861b20e4
diff --git a/src/Config.zig b/src/Config.zig
index c5d1fa360..e2ecb32af 100644
--- a/src/Config.zig
+++ b/src/Config.zig
@@ -652,7 +652,7 @@ pub fn httpNavBurst(self: *const Config) u32 {
pub fn httpConnectTimeout(self: *const Config) u31 {
return switch (self.mode) {
- inline .serve, .fetch, .mcp, .agent => |opts| opts.http_connect_timeout orelse 0,
+ inline .serve, .fetch, .mcp, .agent => |opts| opts.http_connect_timeout orelse 8000,
.version => 0,
else => unreachable,
};
@@ -660,7 +660,7 @@ pub fn httpConnectTimeout(self: *const Config) u31 {
pub fn httpTimeout(self: *const Config) u31 {
return switch (self.mode) {
- inline .serve, .fetch, .mcp, .agent => |opts| opts.http_timeout orelse 5000,
+ inline .serve, .fetch, .mcp, .agent => |opts| opts.http_timeout orelse 15000,
.version => 5000,
else => unreachable,
};
diff --git a/src/help.zon b/src/help.zon
index 90308e9b6..b199c84fc 100644
--- a/src/help.zon
+++ b/src/help.zon
@@ -399,7 +399,7 @@
\\ --http-connect-timeout <INT>
\\ Time in ms to establish an HTTP connection before timing out. 0 means
\\ never.
- \\ Defaults to 0.
+ \\ Defaults to 8000.
\\ --http-header <HEADER>
\\ Extra custom header added to every outgoing HTTP request, including redirections,
\\ in "Name: Value" form. Can be passed multiple times. The last one is used.
@@ -433,7 +433,7 @@
\\ Defaults to none.
\\ --http-timeout <INT>
\\ Maximum time in ms the transfer is allowed to complete. 0 means never.
- \\ Defaults to 10000.
+ \\ Defaults to 15000.
\\ --http-version <VERSION>
\\ HTTP version to negotiate. "1.1" never offers HTTP/2. "auto"
\\ picks the best available option.