
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
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
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 249 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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.