• Stars
    star
    643
  • Rank 70,000 (Top 2 %)
  • Language
    C#
  • License
    MIT License
  • Created over 6 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Request/response Inspector middleware for ASP.NET Core

Rin

Request/response Inspector middleware for ASP.NET Core. like Glimpse.

Build-Release Build-Development NuGet version

Rin captures HTTP requests to ASP.NET Core app and provides viewer for captured data. It's useful tool to debug your Web application (e.g. Web sites, API apps).

✅ Features

Capture requests and responses

Rin captures HTTP traffics between the ASP.NET Core app and any clients.

  • Headers + Body
  • Traces (Microsoft.Extensions.Logging.ILogger, log4net, ...)
  • Unhandled Exception

Inspect from Web browser in realtime

View events timeline

Rin inspector displays events that occurred while processing a request.

Preview a request/response body

Rin inspector can display request and response body with a preview. (e.g. JSON, Image, HTML, JavaScript ...)

View related trace logs

Rin captures a request and response. Also, it captures logs while processing a request.

  • Built-in Microsoft.Extensions.Logging.ILogger integration
  • log4net Appender

Save and export request/response

You can replay a request easily using cURL and LINQPad.

  • Save request/response body
  • Copy request as cURL and C#

Integrate with ASP.NET Core MVC

  • Record timings of view rendering and action execution
  • In-View Inspector (like MiniProfiler)

📝 Requirements

  • .NET Core 3.1+
  • ASP.NET Core 3.1+
  • Modern browser (e.g. Microsoft Edge, Google Chrome, Firefox, Safari...)
    • WebSocket connectivity

⚡ QuickStart

Install NuGet Package

Using Visual Studio

Dependencies -> Manage NuGet Packages... -> Search and install Rin and Rin.Mvc (if your project is built with ASP.NET Core MVC) package.

Using dotnet command

dotnet add package Rin
dotnet add package Rin.Mvc

Using Package Manager

Install-Package Rin
Install-Package Rin.Mvc

Setup and configure Rin

Program.cs

public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
    WebHost.CreateDefaultBuilder(args)
        .ConfigureLogging(configure =>
        {
            // Add: Enable Rin Logger
            configure.AddRinLogger();
        })
        .UseStartup<Startup>();

Startup.cs

public class Startup
{
    ...
    public void ConfigureServices(IServiceCollection services)
    {
        ...
        services.AddControllersWithViews()
            // Add(option): Enable ASP.NET Core MVC support if the project built with ASP.NET Core MVC
            .AddRinMvcSupport();        

        // Add: Register Rin services
        services.AddRin();
    }
    ...
    public void Configure(IApplicationBuilder app, IHostingEnvironment env)
    {
        if (env.IsDevelopment())
        {
            // Add: Enable request/response recording and serve a inspector frontend.
            // Important: `UseRin` (Middlewares) must be top of the HTTP pipeline.
            app.UseRin();

            // Add(option): Enable ASP.NET Core MVC support if the project built with ASP.NET Core MVC
            app.UseRinMvcSupport();

            app.UseDeveloperExceptionPage();

            // Add: Enable Exception recorder. this handler must be after `UseDeveloperExceptionPage`.
            app.UseRinDiagnosticsHandler();
        }
        ...
    }
}

_Layout.cshtml (for ASP.NET Core MVC)

@inject Rin.Mvc.View.RinHelperService RinHelper
...
    <environment include="Development">
        <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
        <link rel="stylesheet" href="~/css/site.css" />
        @* Add: Enable In-View Inspector for ASP.NET Core MVC *@
        @RinHelper.RenderInViewInspector()
    </environment>
...

Start the application and open Inspector on the web

Launch the app, then open http://[Host:Port]/rin/ in the browser, you can see Rin Inspector now.

🔨 Develop and build Rin Inspector (client side)

Rin Inspector (client side) codes is separated from Rin core C# project. If you want to develop Rin (C#) or launch a sample project, you need to build and deploy the artifacts.

[Rin.Frontend, Rin.Mvc.Frontend] Setup and start the development server

  • yarn
  • yarn start

[Rin.Frontend] Build Rin/Resources.zip

  • yarn build
  • yarn pack

[Rin.Mvc.Frontend] Build Rin.Mvc/EmbeddedResources

  • yarn build
  • copy .\dist\static\main.js* ..\Rin.Mvc\EmbeddedResources\

License

MIT License

More Repositories

1

Cocona

Micro-framework for .NET console application. Cocona makes it easy and fast to build console applications on .NET.
C#
3,209
star
2

Kurukuru

Terminal Spinner for .NET platform
C#
656
star
3

Chell

Write scripts with the power of C# and .NET
C#
75
star
4

Beatrice

Everything is a smart home device works with Google Home/Assistant.
C#
66
star
5

WeekRef.NET

WeekRef.NET: 週刊 .NET
JavaScript
59
star
6

PlatformStatusTracker

Tracker for the Web browser platform statuses
C#
41
star
7

ChatworkExtension

ChatWorkを改造します
JavaScript
37
star
8

Qulaly

A library that queries Roslyn's C# syntax tree with CSS selector-like syntax.
C#
30
star
9

Inazuma

Minimal CLR Implementation (MSIL Interpreter) for .NET Framework. Nanodesu!
C#
25
star
10

AppleWirelessKeyboardHelper

C#
22
star
11

Yafp

A toolkit for implementing forward proxy based on ASP.NET Core and YARP.
C#
18
star
12

BraviaControl

Sony BRAVIA remote control API client for .NET
C#
17
star
13

dotnet-sail

Downloads .NET project from Gist, GitHub, Git, or the web and runs it in a container.
C#
14
star
14

Kanae

Kanae - Private Gyazo server written in C# + ASP.NET
JavaScript
12
star
15

Cartelet

.NET Framework向けHTMLパーサー/フィルターライブラリ
C#
11
star
16

SourceGeneratorPlayground

Templates for playing with Source Generator.
C#
10
star
17

Mimosa

Syntax highlighter built with Monaco Editor (Visual Studio Code)
JavaScript
8
star
18

JsonStreamLogger

JSON Stream logger provider implementation for Microsoft.Extensions.Logging.
C#
8
star
19

Pripod

Pripod enables you to easily access Pod information from the .NET app inside a Pod.
C#
8
star
20

AgqrPlayer4Tv

超A&G+をAndroid TVで再生するための雑なアプリ
Kotlin
7
star
21

LetterWriter

Unity向けの日本語テキスト表示ライブラリ
C#
7
star
22

aircvw

Tiarra IRC Log Viewer (Aircvw: えあくぎゅう)
JavaScript
7
star
23

KumoDictionary

IDictionary<TKey, TValue> in the Cloud - Simple NoSQL/KVS wrapper for .NET
C#
6
star
24

Downwrite

Markdown Editor for Metro style apps
JavaScript
5
star
25

SimpleBasicAuthenticationModule

Simple Basic Authentication Module for IIS/ASP.NET
C#
5
star
26

Sample.MonoCecil

C#
5
star
27

Backlog

Backlog API for .NET
C#
4
star
28

MraaSharp

.NET(C#, Mono) binding/wrapper for Intel MRAA library
C#
4
star
29

VistaFace.gadget

JavaScript
4
star
30

KssSharp

A .NET Framework (C#) Implementation of KSS: A methodology for documenting CSS and generating styleguides
C#
3
star
31

Metrica

IRC Client for Metro style apps
JavaScript
3
star
32

Iroha

コンポーネントエディタみたいな何かとASP.NET Web Pagesを吐き出すCMSみたいな何か。
JavaScript
3
star
33

RadioWhip

フィードがないページのフィードを作るアレ
C#
2
star
34

mayuki.github.com

mayuki.github.com
HTML
2
star
35

ThumbSense4Surface

ThumbSense for Surface Pro
C#
2
star
36

SimpleAspNetWebHost

C#
2
star
37

MyPlaceholder

A clone of "placehold.it" / ASP.NET MVC
C#
2
star
38

WatchDotNetGitHubRepos

C#
2
star
39

UniCorefx

.NET 4 BCL の一部 for Unityっぽい
C#
2
star
40

IndentAutoConfigurator

Visual Studio 2012でファイルごとにインデントの設定を自動で切り替える拡張
C#
2
star
41

ViewTgaInGitHub

Enable viewing for TARGA format in GitHub
JavaScript
1
star
42

Samidare

File based blog/page engine for ASP.NET Web Pages
C#
1
star
43

HyperEstraierBinding

HyperEstraier Binding for .NET Framework (C#)
C#
1
star
44

ClassicCgiApp

古き良きCGIアプリっぽいものをASP.NET Coreで再現する
C#
1
star
45

Madosta-20160521-Demo

C#
1
star
46

Mvc4Samples

JavaScript
1
star
47

SassTray

Sass コマンドを実行しつつ通知領域にしまわれるようにするためのアレ。
C#
1
star
48

Cod2013

Community Open Day 2013
JavaScript
1
star
49

DockIconPreviewer

Dock Icon Previewer
1
star