Core logic ported from TS: HttpClientFactory, Environment and WebSocketHandler.

This commit is contained in:
2026-04-09 09:41:16 +02:00
parent 63e52336e2
commit 3ee4edac6c
6 changed files with 132 additions and 7 deletions

19
Core/HttpClientFactory.cs Normal file
View File

@@ -0,0 +1,19 @@
using System;
using System.Net.Http;
namespace Chtn.CSharp.SDK.Core
{
public static class HttpClientFactory
{
public static HttpClient CreateClient(bool isCdn = false)
{
var env = EnvironmentConfig.Get();
return new HttpClient
{
BaseAddress = new Uri(isCdn ? env.CdnUrl : env.ApiUrl),
Timeout = TimeSpan.FromSeconds(5)
};
}
}
}