Skip to content

Instantly share code, notes, and snippets.

View nik-prostok's full-sized avatar

Nikita Prostokvashin nik-prostok

View GitHub Profile
@xfournet
xfournet / pluginHttp2Proxy.ts
Last active May 8, 2024 16:27
Vite support for HTTP2 and proxy
import proxy from 'http2-proxy';
import type { Plugin, ProxyOptions } from 'vite';
export const pluginHttp2Proxy = (): Plugin => {
let routes: Record<string, string | ProxyOptions>;
return {
name: 'vite-plugin-http2-proxy',
config: (config) => {
const { server } = config;
routes = server?.proxy ?? {};