RequestAnalyzer 1.0.9

There is a newer version of this package available.
See the version list below for details.
dotnet add package RequestAnalyzer --version 1.0.9
                    
NuGet\Install-Package RequestAnalyzer -Version 1.0.9
                    
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="RequestAnalyzer" Version="1.0.9" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RequestAnalyzer" Version="1.0.9" />
                    
Directory.Packages.props
<PackageReference Include="RequestAnalyzer" />
                    
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 RequestAnalyzer --version 1.0.9
                    
#r "nuget: RequestAnalyzer, 1.0.9"
                    
#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 RequestAnalyzer@1.0.9
                    
#: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=RequestAnalyzer&version=1.0.9
                    
Install as a Cake Addin
#tool nuget:?package=RequestAnalyzer&version=1.0.9
                    
Install as a Cake Tool

RequestAnalyzer

A powerful .NET library for comprehensive HTTP request analysis with built-in security detection, device identification, and proxy chain analysis.

Features

  • Comprehensive Request Analysis: Extract IP address, device type, browser information, and more
  • Security Detection: VPN detection, suspicious request analysis with confidence scoring
  • Proxy Chain Analysis: Detect and analyze proxy chains from X-Forwarded-For headers
  • Device Detection: Automatic device type identification (Desktop, Mobile, Tablet)
  • Correlation ID: Automatic correlation ID generation and discovery
  • Easy Integration: Simple dependency injection integration

Installation

dotnet add package RequestAnalyzer

Quick Start

Basic Setup

using RequestAnalyzer;

var builder = WebApplication.CreateBuilder(args);

// Add RequestAnalyzer services
builder.Services.AddRequestAnalyzer();

var app = builder.Build();

app.Run();

Advanced Configuration

// Configure RequestAnalyzer with custom options
builder.Services.AddRequestAnalyzer(options =>
{
    options.EnableVPNDetection = true;
    options.EnableSuspiciousRequestDetection = true;
    options.VPNConfidenceThreshold = 80;
    options.SuspiciousRequestScoreThreshold = 70;
});

Usage

Inject and Use RequestAnalyzer

using RequestAnalyzer;
using Microsoft.AspNetCore.Mvc;

public class MyController : ControllerBase
{
    private readonly RequestAnalyzer.RequestAnalyzer _requestAnalyzer;

    public MyController(RequestAnalyzer.RequestAnalyzer requestAnalyzer)
    {
        _requestAnalyzer = requestAnalyzer;
    }

    [HttpGet]
    public IActionResult Get()
    {
        // Access request analysis data
        var clientIP = _requestAnalyzer.IP;
        var deviceType = _requestAnalyzer.Device;
        var isSuspicious = _requestAnalyzer.IsSuspiciousRequest;
        var isUsingVPN = _requestAnalyzer.IsUsingVPN;
        var correlationId = _requestAnalyzer.CorrelationId;
        var browser = _requestAnalyzer.Browser;
        
        return Ok(new { 
            IP = clientIP, 
            Device = deviceType,
            IsSuspicious = isSuspicious,
            IsUsingVPN = isUsingVPN,
            CorrelationId = correlationId,
            Browser = browser.BrowserName,
            OperatingSystem = browser.OperatingSystem
        });
    }
}

Available Properties

Basic Information

  • Language (string): Detected language from request headers
  • IP (string): Client IP address (handles proxies correctly)
  • IsPrivateIP (bool?): Whether the IP is private/internal
  • CorrelationId (string): Request correlation ID for tracing
  • Device (DeviceType): Device type (Unknown, Desktop, Mobile, Tablet)

Browser Information

  • Browser (BrowserInfo): Detailed browser and OS information
    • Browser.BrowserName: Browser name (e.g., "Chrome", "Firefox")
    • Browser.OperatingSystem: OS name (e.g., "Windows", "macOS")
    • Browser.OperatingSystemVersion: OS version

Proxy Chain Analysis

  • ProxyChain (IPAddress[]): Array of proxies in the chain
  • ProxyCount (int): Number of proxies in the chain
  • FirstProxy (IPAddress): First proxy in the chain
  • LastProxy (IPAddress): Last proxy in the chain
  • IsFromTrustedProxy (bool): Whether request is from trusted proxy

VPN Detection

  • IsUsingVPN (bool): Whether client is using VPN
  • VPNConfidenceScore (int): Confidence score 0-100

Security Analysis

  • IsSuspiciousRequest (bool): Whether request is suspicious
  • SuspiciousScore (int): Suspicious score 0-100
  • SuspiciousReasons (string): Semicolon-separated list of reasons

Configuration Options

public class RequestAnalyzerOptions
{
    public bool EnableVPNDetection { get; set; } = true;
    public bool EnableSuspiciousRequestDetection { get; set; } = true;
    public int VPNConfidenceThreshold { get; set; } = 70;
    public int SuspiciousRequestScoreThreshold { get; set; } = 60;
}

Device Types

public enum DeviceType
{
    Unknown = 0,
    Desktop = 1,
    Mobile = 2,
    Tablet = 3
}

License

MIT

Requirements

  • .NET 9.0 or higher
  • ASP.NET Core
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.
  • net9.0

    • No dependencies.

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.0.17 324 11/17/2025
1.0.16 227 11/4/2025
1.0.15 228 11/2/2025
1.0.14 163 11/1/2025
1.0.13 222 10/30/2025
1.0.12 210 10/30/2025
1.0.11 213 10/30/2025
1.0.10 218 10/30/2025
1.0.9 217 10/29/2025
1.0.8 212 10/29/2025
1.0.7 221 10/29/2025
1.0.6 231 11/2/2025
1.0.5 232 11/2/2025
1.0.4 217 11/2/2025
1.0.3 219 11/2/2025
1.0.0 215 10/29/2025

Initial release with comprehensive request analysis features