Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion tools/Kute/Nethermind.Tools.Kute/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using Nethermind.Tools.Kute.SecretProvider;
using Nethermind.Tools.Kute.SystemClock;
using System.CommandLine;
using System.Net;

namespace Nethermind.Tools.Kute;

Expand Down Expand Up @@ -56,7 +57,18 @@ private static IServiceProvider BuildServiceProvider(ParseResult parseResult)

collection.AddSingleton<Application>();
collection.AddSingleton<ISystemClock, RealSystemClock>();
collection.AddSingleton<HttpClient>();
collection.AddSingleton<HttpClient>(_ =>
{
// Disable proxy auto-detection to avoid timeout (~2s) on Windows.
// Each Kute invocation is a separate process, so the proxy lookup
// would otherwise be paid on every single measured request.
var handler = new SocketsHttpHandler
{
UseProxy = false,
AutomaticDecompression = DecompressionMethods.None,
};
return new HttpClient(handler);
});
collection.AddSingleton<ISecretProvider>(new FileSecretProvider(parseResult.GetValue(Config.JwtSecretFilePath)!));
collection.AddSingleton<IAuth>(provider =>
new TtlAuth(
Expand Down