A .NET library that provides easy integration of Vite development server proxying in ASP.NET Core applications using YARP (Yet Another Reverse Proxy).
dotnet add package ViteDevProxyAdd ViteDevProxy to your ASP.NET Core application:
using ViteDevProxy;
var builder = WebApplication.CreateBuilder(args);
// Add ViteDevProxy services (defaults to http://localhost:5173/)
builder.Services.AddViteDevProxy();
var app = builder.Build();
// Map the reverse proxy
app.MapViteDevProxy();
app.Run();// Configure custom Vite dev server URL
builder.Services.AddViteDevProxy("http://localhost:3000/");ViteDevProxy automatically configures YARP to:
- Proxy all requests (
{**catch-all}) to your Vite development server - Handle WebSocket connections for Hot Module Replacement (HMR)
- Maintain proper headers and request context
-
Start your Vite development server:
npm run dev
-
Start your ASP.NET Core application with ViteDevProxy configured
-
Access your application through the ASP.NET Core server - all frontend requests will be automatically proxied to Vite
- .NET 10.0
- Vite development server running (typically on port 5173)
MIT