
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
vite-dynamic-proxy
Advanced tools
A Vite plugin that enables dynamic proxy configuration at runtime, allowing flexible and configurable proxy settings for development servers
A Vite plugin that enables dynamic proxy configuration at runtime, allowing you to change proxy target using URL query parameters without restarting the development server.
npm install vite-dynamic-proxy
// vite.config.ts
import { defineConfig } from 'vite'
import { dynamicProxyPlugin } from 'vite-dynamic-proxy'
export default defineConfig({
plugins: [
dynamicProxyPlugin({
// Required: Default target URL for the proxy
defaultTarget: 'http://localhost:3000',
// Required: Path to proxy (e.g., '/api' or '^/api')
path: '/api',
// Optional: Change origin header (default: true)
changeOrigin: true
})
]
})
Option | Type | Description | Default |
---|---|---|---|
defaultTarget | string | Default target URL for the proxy (required) | - |
path | string | Path to proxy, can be a simple path or regex starting with ^ (required) | - |
changeOrigin | boolean | Changes the origin of the host header | true |
You can change the proxy target at runtime by adding a debug
query parameter to your URL. The plugin supports both HTTP and HTTPS targets:
# Using HTTP
http://localhost:5173/your-app?debug=localhost:3001
# Using explicit HTTP
http://localhost:5173/your-app?debug=http://localhost:3001
# Using HTTPS
http://localhost:5173/your-app?debug=https://api.example.com
When using HTTPS targets, the plugin automatically sets secure: false
to allow self-signed certificates.
// Simple path matching
dynamicProxyPlugin({
defaultTarget: 'http://localhost:3000',
path: '/api' // Will match paths starting with /api
})
// Regex path matching
dynamicProxyPlugin({
defaultTarget: 'http://localhost:3000',
path: '^/api' // Will match paths using regex pattern
})
npm install
- Install dependenciesnpm run build
- Build the pluginnpm run test
- Run testsnpm run test:coverage
- Run tests with coveragenpm run lint
- Run ESLintnpm run typecheck
- Run TypeScript type checkingISC
[1.1.0] - 2025-05-07
FAQs
A Vite plugin that enables dynamic proxy configuration at runtime, allowing flexible and configurable proxy settings for development servers
The npm package vite-dynamic-proxy receives a total of 634 weekly downloads. As such, vite-dynamic-proxy popularity was classified as not popular.
We found that vite-dynamic-proxy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.