feat: Add Kestrel HTTP/2 configuration for macOS
This commit is contained in:
@@ -8,12 +8,24 @@ using Microsoft.Extensions.Logging;
|
|||||||
using Serilog.Core;
|
using Serilog.Core;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
using Microsoft.OpenApi.Models;
|
using Microsoft.OpenApi.Models;
|
||||||
using CMSMicroservice.WebApi.Common.Behaviours;
|
using CMSMicroservice.WebApi.Common.Behaviours;
|
||||||
using Hangfire;
|
using Hangfire;
|
||||||
using Hangfire.SqlServer;
|
using Hangfire.SqlServer;
|
||||||
|
using Microsoft.AspNetCore.Server.Kestrel.Core;
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
||||||
|
{
|
||||||
|
builder.WebHost.ConfigureKestrel(options =>
|
||||||
|
{
|
||||||
|
// Setup a HTTP/2 endpoint without TLS.
|
||||||
|
options.ListenLocalhost(5000, o => o.Protocols =
|
||||||
|
HttpProtocols.Http2);
|
||||||
|
});
|
||||||
|
}
|
||||||
var levelSwitch = new LoggingLevelSwitch();
|
var levelSwitch = new LoggingLevelSwitch();
|
||||||
|
|
||||||
// Read Seq configuration from appsettings.json
|
// Read Seq configuration from appsettings.json
|
||||||
|
|||||||
Reference in New Issue
Block a user