diff --git a/GenHTTP.Gateway.Tests/GenHTTP.Gateway.Tests.csproj b/GenHTTP.Gateway.Tests/GenHTTP.Gateway.Tests.csproj index 81c3bf0..598e808 100644 --- a/GenHTTP.Gateway.Tests/GenHTTP.Gateway.Tests.csproj +++ b/GenHTTP.Gateway.Tests/GenHTTP.Gateway.Tests.csproj @@ -23,7 +23,7 @@ - + diff --git a/GenHTTP.Gateway/Configuration/GatewayConfiguration.cs b/GenHTTP.Gateway/Configuration/GatewayConfiguration.cs index 3380ab2..4dca1f2 100644 --- a/GenHTTP.Gateway/Configuration/GatewayConfiguration.cs +++ b/GenHTTP.Gateway/Configuration/GatewayConfiguration.cs @@ -3,6 +3,8 @@ public class GatewayConfiguration { + public bool? EnableQuic { get; set; } + public Dictionary? Hosts { get; set; } } \ No newline at end of file diff --git a/GenHTTP.Gateway/Engine.cs b/GenHTTP.Gateway/Engine.cs index f887dbe..b99c15e 100644 --- a/GenHTTP.Gateway/Engine.cs +++ b/GenHTTP.Gateway/Engine.cs @@ -35,14 +35,16 @@ public static IServerHost Setup(Environment environment, GatewayConfiguration co if (certificateProvider != null) { + var quic = config.EnableQuic ?? false; + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { - server.Bind(IPAddress.Any, securePort, certificateProvider) - .Bind(IPAddress.IPv6Any, securePort, certificateProvider); + server.Bind(IPAddress.Any, securePort, certificateProvider, enableQuic: quic) + .Bind(IPAddress.IPv6Any, securePort, certificateProvider, enableQuic: quic); } else { - server.Bind(IPAddress.Any, securePort, certificateProvider); + server.Bind(IPAddress.Any, securePort, certificateProvider, enableQuic: quic); } } diff --git a/GenHTTP.Gateway/GenHTTP.Gateway.csproj b/GenHTTP.Gateway/GenHTTP.Gateway.csproj index 63f13ba..e7975e4 100644 --- a/GenHTTP.Gateway/GenHTTP.Gateway.csproj +++ b/GenHTTP.Gateway/GenHTTP.Gateway.csproj @@ -26,15 +26,15 @@ - + - + - + - + - + diff --git a/GenHTTP.Gateway/Resources/Default.yaml b/GenHTTP.Gateway/Resources/Default.yaml index 12d6659..bd3800c 100644 --- a/GenHTTP.Gateway/Resources/Default.yaml +++ b/GenHTTP.Gateway/Resources/Default.yaml @@ -1,4 +1,8 @@ -hosts: +# activate to enable HTTP/3 via QUIC +# requires port 443 to be reachable via UDP +enableQuic: false + +hosts: # configuration for a specific host # duplicate this entry to add another host