Add Flypaper solution skeleton with HTTP tarpit, SQLite event log and tests
This commit is contained in:
1 parent
20314268c6
commit
f9161f48e7
55 files changed
+1331
No files matched your search
@@ -0,0 +1,19 @@
|
||||
using System.Collections.Concurrent;
|
||||
using System.Net;
|
||||
using Flypaper.Core;
|
||||
|
||||
namespace Flypaper.Tests;
|
||||
|
||||
internal sealed class FakeTrapChannel : ITrapChannel
|
||||
{
|
||||
public TrapSession Session { get; } = new(Guid.NewGuid(), TrapProtocol.Http, IPAddress.Loopback, DateTimeOffset.UtcNow);
|
||||
|
||||
public ConcurrentQueue<byte[]> Writes { get; } = new();
|
||||
|
||||
public ValueTask WriteAsync(ReadOnlyMemory<byte> data, CancellationToken ct)
|
||||
{
|
||||
ct.ThrowIfCancellationRequested();
|
||||
Writes.Enqueue(data.ToArray());
|
||||
return ValueTask.CompletedTask;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user