Skip to content

Commit

Permalink
Support load http proxy environment variables (#1604)
Browse files Browse the repository at this point in the history
zig project (ziglang/zig#17407)
add client.loadDefaultProxies to loads proxy environment variables
(http_proxy, HTTP_PROXY, https_proxy, HTTPS_PROXY, all_proxy, ALL_PROXY).
  • Loading branch information
jimying authored Nov 22, 2023
1 parent a67fef8 commit 62f17ab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/config_gen/config_gen.zig
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,9 @@ fn httpGET(allocator: std.mem.Allocator, uri: std.Uri) !Response {
defer client.deinit();
try client.ca_bundle.rescan(allocator);

if (@hasDecl(std.http.Client, "loadDefaultProxies"))
try client.loadDefaultProxies();

var request = try client.open(.GET, uri, .{ .allocator = allocator }, .{});
defer request.deinit();

Expand Down

0 comments on commit 62f17ab

Please sign in to comment.