Something went wrong. Try again.
Something went wrong. Try again.
123456789101112131415161718192021const std = @import("std");
pub fn main(init: std.process.Init) !void { var client: std.http.Client = .{ .allocator = init.gpa, .io = init.io }; defer client.deinit(); for ([_][]const u8{ "https://dv-g3b-emudhra.we-have-a-problem.com/", "https://dv-g3b-aaa-emudhra.we-have-a-problem.com/", }) |url| { if (client.fetch(.{ .location = .{ .url = url }, .keep_alive = false })) |_| { return error.CompromisedChainAccepted; } else |err| { if (err != error.TlsInitializationFailed) return err; std.debug.print("std.http rejected {s}: {s}\n", .{ url, @errorName(err) }); } } const control = try client.fetch(.{ .location = .{ .url = "https://atproto.com/" }, .keep_alive = false }); if (control.status != .ok) return error.ControlFailed; std.debug.print("std.http atproto.com control: 200\n", .{});}