Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ jobs:

# Paths mirror the src/ grouping in ioxide.slnx (core, protocols/, clients/, serving/).
# Every project carrying a PackageId is packed. ioxide.httpclient is the whole client -
# h1, h2c (nghttp2 bundled inside it) and h3 - and project-references ngtcp2/nghttp3,
# so those ship as its NuGet dependencies.
# h1, h2 and h3 - and project-references http2/ngtcp2/nghttp3, so those ship as its NuGet
# dependencies. ioxide.nghttp2 is packed too but nothing depends on it: it is a
# standalone server-side alternative now, not something the client pulls in.
- name: Pack ioxide
run: dotnet pack src/ioxide/ioxide.csproj --configuration Release --no-build --output ./artifacts

Expand Down
2 changes: 1 addition & 1 deletion Playground/Clients/Http/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// the same GetAsync is h1 on the first request and h3 later. Http1Only / Http2Only (h2c) /
// Http3Only pin it instead, which is what the nine Proxy/* samples do.
//
// dotnet run -c Release --project Playground/Http3/Nghttp3 # an origin that advertises h3
// dotnet run -c Release --project Playground/Http3/Nghttp3Request # an origin that advertises h3
// PLAYGROUND_UPSTREAM_PORT=8080 dotnet run -c Release --project Playground/Clients/Http
// curl http://127.0.0.1:8090/
//
Expand Down
4 changes: 2 additions & 2 deletions Playground/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# docker build -f Playground/Dockerfile --build-arg SAMPLE=Tcp/Raw -t playground-raw .
# docker run --rm -p 8080:8080 playground-raw
#
# docker build -f Playground/Dockerfile --build-arg SAMPLE=Http3/Nghttp3 -t playground-h3 .
# docker build -f Playground/Dockerfile --build-arg SAMPLE=Http3/Nghttp3Request -t playground-h3 .
# docker run --rm -p 8080:8080 -p 8443:8443/udp playground-h3
#
# SAMPLE is the directory path under Playground/ - any directory that carries a csproj:
# Tcp/Raw, Tcp/Pipe, Tls/OpenSsl, Http2/Nghttp2, Http3/Nghttp3, Clients/Pg, Proxy/H1ToH1, ...
# Tcp/Raw, Tcp/Pipe, Tls/OpenSsl, Http2/Nghttp2, Http3/Nghttp3Request, Clients/Pg, Proxy/H1ToH1, ...
ARG SAMPLE=Tcp/Raw

FROM mcr.microsoft.com/dotnet/sdk:11.0-preview AS build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<RootNamespace>Playground.Http2.Managed</RootNamespace>
<AssemblyName>Playground.Http2.Managed</AssemblyName>
<RootNamespace>Playground.Http2.Buffered</RootNamespace>
<AssemblyName>Playground.Http2.Buffered</AssemblyName>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// http2 - an HTTP/2 server in pure C#: framing, HPACK and flow control; ioxide owns the
// ring, the loop and the connection, so a response is written straight into the write slab.
//
// dotnet run -c Release --project Playground/Http2/Managed
// dotnet run -c Release --project Playground/Http2/Buffered
// curl --http2-prior-knowledge http://127.0.0.1:8080/hello
//
// This is h2c with PRIOR KNOWLEDGE: the peer opens with the HTTP/2 connection preface and no
Expand Down Expand Up @@ -71,8 +71,8 @@
{
try
{
// The connection owns the read loop from here: it feeds nghttp2, dispatches each
// request once its stream ends, and drains the egress once per batch.
// The connection owns the read loop from here: it parses frames, dispatches each
// request once its stream ends, and flushes the batch in one write.
await new Http2Connection(conn).RunBufferedAsync(_ => new Http2Response
{
Status = 200,
Expand All @@ -89,7 +89,7 @@
threads[i].Start();
}

Console.WriteLine($"[http2] {config.ReactorCount} reactors on :{config.Tcp!.Port}, "
Console.WriteLine($"[http2-buffered] {config.ReactorCount} reactors on :{config.Tcp!.Port}, "
+ $"{body.Length}-byte body (h2c prior knowledge)");

foreach (Thread thread in threads)
Expand Down
232 changes: 0 additions & 232 deletions Playground/Http2/ManagedTls/Program.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<RootNamespace>Playground.Http2.Nghttp2</RootNamespace>
<AssemblyName>Playground.Http2.Nghttp2</AssemblyName>
<RootNamespace>Playground.Http2.Nghttp2Buffered</RootNamespace>
<AssemblyName>Playground.Http2.Nghttp2Buffered</AssemblyName>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<ItemGroup>
<ProjectReference Include="../../Shared/Playground.Shared.csproj" />
<ProjectReference Include="../../../src/ioxide/ioxide.csproj" />
<ProjectReference Include="../../../src/protocols/ioxide.nghttp2/ioxide.nghttp2.csproj" />
<ProjectReference Include="../../../src/protocols/ioxide.http2/ioxide.http2.csproj" />
</ItemGroup>

</Project>
10 changes: 5 additions & 5 deletions Playground/Http2/SslStream/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Security.Authentication;
using System.Security.Cryptography.X509Certificates;
using ioxide;
using ioxide.nghttp2;
using ioxide.http2;
using Playground.Shared;

// ─────────────────────────────────────────────────────────────────────────────────────────────
Expand All @@ -13,12 +13,12 @@
// dotnet run -c Release --project Playground/Http2/SslStream
// curl -k --http2 https://127.0.0.1:8443/
//
// The point of this sample is what it demonstrates about the shape: Nghttp2Connection takes an
// The point of this sample is what it demonstrates about the shape: Http2Connection takes an
// IDuplexPipe, and a Stream can be one in about ten lines (below). So the same HTTP/2 code runs
// over the ring directly, over kTLS, or over SslStream, without knowing which - the transport is
// a constructor argument, not a branch inside the protocol.
//
// Compare with Playground/Http2/Tls for the ioxide.tls version. Needs: ioxide, ioxide.nghttp2
// Compare with Playground/Http2/Tls for the ioxide.tls version. Needs: ioxide, ioxide.http2
// ─────────────────────────────────────────────────────────────────────────────────────────────

// ── Knobs ────────────────────────────────────────────────────────────────────────────────────
Expand Down Expand Up @@ -90,8 +90,8 @@ await ssl.AuthenticateAsServerAsync(new SslServerAuthenticationOptions
return; // this sample only serves h2; see Playground/Http2/Tls for the fallback
}

await new Nghttp2Connection(new StreamDuplexPipe(ssl)).RunBufferedAsync(
_ => new Nghttp2Response { Status = 200, Body = body });
await new Http2Connection(new StreamDuplexPipe(ssl)).RunBufferedAsync(
_ => new Http2Response { Status = 200, Body = body });
}
catch (Exception e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<RootNamespace>Playground.Http2.ManagedTls</RootNamespace>
<AssemblyName>Playground.Http2.ManagedTls</AssemblyName>
<RootNamespace>Playground.Http2.StreamedBoth</RootNamespace>
<AssemblyName>Playground.Http2.StreamedBoth</AssemblyName>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading
Loading