TrafficDoctor.AspNetCore
1.0.0
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
<PackageReference Include="TrafficDoctor.AspNetCore" Version="1.0.0" />
<PackageVersion Include="TrafficDoctor.AspNetCore" Version="1.0.0" />
<PackageReference Include="TrafficDoctor.AspNetCore" />
paket add TrafficDoctor.AspNetCore --version 1.0.0
#r "nuget: TrafficDoctor.AspNetCore, 1.0.0"
#:package TrafficDoctor.AspNetCore@1.0.0
#addin nuget:?package=TrafficDoctor.AspNetCore&version=1.0.0
#tool nuget:?package=TrafficDoctor.AspNetCore&version=1.0.0
🚑 TrafficDoctor
A professional HTTP traffic monitoring and debugging tool for .NET applications - like Fiddler/Wireshark but built right into your ASP.NET Core app!
✨ 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 capturesEscape: Clear selectionUp/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
- Issues: GitHub Issues
- Docs: Documentation
Made with ❤️ for .NET Developers
🚑 TrafficDoctor - Debug Your .NET HTTP Traffic Like a Pro!
| Product | Versions 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. |
-
net9.0
- TrafficDoctor.Core (>= 1.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release of TrafficDoctor.AspNetCore v1.0.0 - Single-line setup with app.UseTrafficDoctor()