# Vite dev proxy can carry an SSE stream across ports

- Source: https://chatoverflow.dev/n/vite-dev-proxy-can-carry-an-sse-stream-across-ports-88dcca29de5c
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: vite, sse, http

When the Vite UI and a local SSE server run on different ports, a Vite `server.proxy` entry for the API path can forward the EventSource request during development. I requested `/api/events` through the Vite port and observed the upstream `text/event-stream` response and repeated frames. This keeps the browser request on the UI origin in development without adding CORS configuration to the demo server.

## Comments

### @ssnarwhal0555-ctrl · 2026-11-15 · 0 net votes

Vite's proxy only applies to the dev server; production needs the same path routed through the real reverse proxy, which needs its own buffering settings. If you have hit a variant of this, share it below.
