Skip to content

Commit

Permalink
Update to GenHTTP 9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaliumhexacyanoferrat committed Nov 22, 2024
1 parent 0874441 commit 4aea871
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion GenHTTP.Gateway.Tests/GenHTTP.Gateway.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<ItemGroup>

<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />

<PackageReference Include="MSTest.TestAdapter" Version="3.6.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.3" />
Expand Down
2 changes: 2 additions & 0 deletions GenHTTP.Gateway/Configuration/GatewayConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
public class GatewayConfiguration
{

public bool? EnableQuic { get; set; }

public Dictionary<string, HostConfiguration>? Hosts { get; set; }

}
8 changes: 5 additions & 3 deletions GenHTTP.Gateway/Engine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
10 changes: 5 additions & 5 deletions GenHTTP.Gateway/GenHTTP.Gateway.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@

<ItemGroup>

<PackageReference Include="GenHTTP.Core.Kestrel" Version="9.0.0" />
<PackageReference Include="GenHTTP.Core.Kestrel" Version="9.1.0" />

<PackageReference Include="GenHTTP.Modules.DirectoryBrowsing" Version="9.0.0" />
<PackageReference Include="GenHTTP.Modules.DirectoryBrowsing" Version="9.1.0" />

<PackageReference Include="GenHTTP.Modules.IO" Version="9.0.0" />
<PackageReference Include="GenHTTP.Modules.IO" Version="9.1.0" />

<PackageReference Include="GenHTTP.Modules.ReverseProxy" Version="9.0.0" />
<PackageReference Include="GenHTTP.Modules.ReverseProxy" Version="9.1.0" />

<PackageReference Include="GenHTTP.Modules.VirtualHosting" Version="9.0.0" />
<PackageReference Include="GenHTTP.Modules.VirtualHosting" Version="9.1.0" />

<PackageReference Include="YamlDotNet" Version="16.2.0" />

Expand Down
6 changes: 5 additions & 1 deletion GenHTTP.Gateway/Resources/Default.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 4aea871

Please sign in to comment.