TrafficDoctor.AspNetCore 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package TrafficDoctor.AspNetCore --version 1.0.0
                    
NuGet\Install-Package TrafficDoctor.AspNetCore -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TrafficDoctor.AspNetCore" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TrafficDoctor.AspNetCore" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="TrafficDoctor.AspNetCore" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TrafficDoctor.AspNetCore --version 1.0.0
                    
#r "nuget: TrafficDoctor.AspNetCore, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TrafficDoctor.AspNetCore@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TrafficDoctor.AspNetCore&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=TrafficDoctor.AspNetCore&version=1.0.0
                    
Install as a Cake Tool

🚑 TrafficDoctor

A professional HTTP traffic monitoring and debugging tool for .NET applications - like Fiddler/Wireshark but built right into your ASP.NET Core app!

NuGet License: MIT .NET 9.0

✨ Features

  • 🎯 Zero Configuration - Just app.UseTrafficDoctor() and you're done!
  • 📊 Beautiful Dashboard - Modern, responsive Blazor UI with real-time updates
  • ⚡ Real-time Updates - SignalR-powered live traffic monitoring
  • 🔍 Advanced Filtering - Search by URL, method, status code, duration, and more
  • 📈 Performance Analytics - Bottleneck detection, statistics, and timing analysis
  • 💾 Export Capabilities - Export to JSON, HAR, or CSV formats
  • 🔒 Production-Safe - Built-in authentication, data sanitization, and development-only mode
  • ⚙️ Request Replay - Replay captured requests with modifications
  • 📦 Minimal Overhead - Circular buffer with ~50MB memory footprint for 1000 requests
  • 🎨 Dark/Light Theme - Switch between themes with a single click

🚀 Quick Start

Installation

dotnet add package TrafficDoctor.AspNetCore

Setup (2 lines of code!)

var builder = WebApplication.CreateBuilder(args);

// Add TrafficDoctor services
builder.Services.AddTrafficDoctor();

var app = builder.Build();

// Use TrafficDoctor (middleware + endpoints + dashboard)
app.UseTrafficDoctor();

app.Run();

That's it! Navigate to https://localhost:5001/trafficdoctor to see your dashboard.

🎉 TrafficDoctor is now capturing all your HTTP requests!

📸 Özellikler

🎛️ Dashboard

  • Real-Time Capture List: Tüm HTTP istekleri anlık olarak gösterilir
  • Statistics Panel: Total requests, success rate, avg response time, requests/sec
  • Request Details:
    • Overview: Method, URL, protocol, IP
    • Headers: Request ve response headers
    • Body: Request ve response body (formatted JSON)
    • Timing: Performance metrics ve timing analizi

📊 Performance Monitoring

  • Response time tracking
  • Throughput analysis
  • Bottleneck detection
  • Status code distribution
  • Endpoint hit counts

💾 Export Options

// Dashboard'dan Export düğmesine tıklayın veya API kullanın:
GET /api/trafficdoctor/export/json
GET /api/trafficdoctor/export/har   // HTTP Archive format
GET /api/trafficdoctor/export/csv

⚙️ Konfigürasyon

appsettings.json ile

{
  "TrafficDoctor": {
    "Enabled": true,
    "MaxStoredRequests": 1000,
    "CaptureRequestBody": true,
    "CaptureResponseBody": true,
    "MaxBodySize": 1048576,
    "ExcludedPaths": [
      "/health",
      "/metrics",
      "/trafficdoctor"
    ],
    "ExcludedHeaders": [
      "Authorization",
      "Cookie",
      "Set-Cookie"
    ],
    "Security": {
      "RequireAuthentication": false,
      "DashboardPath": "/trafficdoctor"
    }
  }
}

Kod ile

builder.Services.AddTrafficDoctor(options =>
{
    options.MaxStoredRequests = 500;
    options.CaptureRequestBody = true;
    options.CaptureResponseBody = true;
    options.MaxBodySize = 2 * 1024 * 1024; // 2MB
});

Development-Only Mode

// Sadece development ortamında aktif olsun
builder.Services.AddTrafficDoctorForDevelopment(
    builder.Environment,
    options => {
        options.MaxStoredRequests = 1000;
    }
);

🔒 Güvenlik

Sensitive Data Filtering

TrafficDoctor varsayılan olarak hassas bilgileri filtreler:

  • Authorization headers
  • Cookie headers
  • Set-Cookie headers

Authentication

{
  "TrafficDoctor": {
    "Security": {
      "RequireAuthentication": true,
      "AllowedRoles": ["Admin", "Developer"]
    }
  }
}

📦 Paket Yapısı

  • TrafficDoctor.Core: Core models ve abstractions
  • TrafficDoctor.AspNetCore: ASP.NET Core middleware ve SignalR hub
  • TrafficDoctor.UI: Embedded Blazor dashboard

🎯 Use Cases

Development

  • API debugging
  • Request/response inspection
  • Performance profiling
  • Error tracking

Testing

  • Integration test monitoring
  • Load test analysis
  • API behavior verification

Production (Optional)

  • Performance monitoring
  • Bottleneck detection
  • Error analysis

📊 Dashboard Klavye Kısayolları

  • Ctrl/Cmd + K: Search captures
  • Escape: Clear selection
  • Up/Down: Navigate captures

🔧 API Endpoints

TrafficDoctor kendi REST API'sini de sunar:

GET  /api/trafficdoctor/captures          - Tüm captures
GET  /api/trafficdoctor/captures/{id}     - Specific capture
POST /api/trafficdoctor/captures/search   - Search captures
GET  /api/trafficdoctor/statistics        - Statistics
GET  /api/trafficdoctor/count             - Capture count
POST /api/trafficdoctor/export/json       - Export JSON
POST /api/trafficdoctor/export/har        - Export HAR
POST /api/trafficdoctor/export/csv        - Export CSV
DELETE /api/trafficdoctor/captures        - Clear all

🧪 Testing

# Run tests
dotnet test

# Sample WebAPI
cd samples/TrafficDoctor.Sample.WebApi
dotnet run

🚀 Performance

  • Minimal Overhead: <5ms per request
  • Memory Efficient: Circular buffer ile automatic eviction
  • Thread-Safe: Concurrent request handling
  • Async Processing: Non-blocking capture storage

📝 Examples

Simple API Monitoring

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddTrafficDoctor();

var app = builder.Build();
app.UseTrafficDoctor();

app.MapGet("/api/users", () => new[] { "User1", "User2" });
app.MapTrafficDoctor();

app.Run();

Custom Configuration

builder.Services.AddTrafficDoctor(options =>
{
    options.MaxStoredRequests = 2000;
    options.MaxBodySize = 5 * 1024 * 1024; // 5MB
    options.ExcludedPaths.Add("/swagger");
    options.ExcludedPaths.Add("/api/public");
});

Dashboard Custom Path

// Dashboard /monitoring'de olsun
app.MapTrafficDoctor("/monitoring");

// Şimdi: http://localhost:5000/monitoring

🛠️ Requirements

  • .NET 6.0 or higher
  • ASP.NET Core application

📄 License

MIT License - free for commercial use

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📞 Support


Made with ❤️ for .NET Developers

🚑 TrafficDoctor - Debug Your .NET HTTP Traffic Like a Pro!

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 107 12/30/2025
1.0.0 106 12/27/2025

Initial release of TrafficDoctor.AspNetCore v1.0.0 - Single-line setup with app.UseTrafficDoctor()