diff --git a/src/YetAnotherHttpHandler/NativeHttpHandlerCore.cs b/src/YetAnotherHttpHandler/NativeHttpHandlerCore.cs index cb10290..a378728 100644 --- a/src/YetAnotherHttpHandler/NativeHttpHandlerCore.cs +++ b/src/YetAnotherHttpHandler/NativeHttpHandlerCore.cs @@ -187,6 +187,10 @@ private unsafe void Initialize(YahaNativeContext* ctx, NativeClientSettings sett if (settings.UnixDomainSocketPath is { } unixDomainSocketPath) { if (YahaEventSource.Log.IsEnabled()) YahaEventSource.Log.Info($"Option '{nameof(settings.UnixDomainSocketPath)}' = {unixDomainSocketPath}"); + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + throw new PlatformNotSupportedException("Unix domain socket is not supported on Windows."); + } var strBytes = Encoding.UTF8.GetBytes(unixDomainSocketPath); fixed (byte* buffer = strBytes) { diff --git a/test/YetAnotherHttpHandler.Test/UdsTest.cs b/test/YetAnotherHttpHandler.Test/UdsTest.cs index 2a473c3..9653c80 100644 --- a/test/YetAnotherHttpHandler.Test/UdsTest.cs +++ b/test/YetAnotherHttpHandler.Test/UdsTest.cs @@ -40,4 +40,25 @@ protected override Task LaunchServerAsyncCore(Action(async () => + { + await httpClient.GetAsync("http://localhost/"); + }); + } } \ No newline at end of file