# @lwrjs/dev-proxy-server

Latest version **0.24.1** (published 2026-09-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @lwrjs/dev-proxy-server
pnpm add @lwrjs/dev-proxy-server
yarn add @lwrjs/dev-proxy-server
bun add @lwrjs/dev-proxy-server
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.24.1 |
| Published | 2026-09-15 |
| First published | 2023-10-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=22.0.0 |
| Dependencies | 4 |
| Unpacked size | 33.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | nrkruk, lpomerleau, lwc-admin, kmbauer, kevinv11n |

## Links

- npm: https://www.npmjs.com/package/@lwrjs/dev-proxy-server
- Repository: https://github.com/salesforce-experience-platform-emu/lwr
- Homepage: https://developer.salesforce.com/docs/platform/lwr/overview
- Issues: https://github.com/salesforce-experience-platform-emu/lwr/issues
- npm.io page: https://npm.io/package/@lwrjs/dev-proxy-server

## Dependencies (4)

- [express](https://npm.io/package/express.md) ^4.20.0
- [@lwrjs/diagnostics](https://npm.io/package/@lwrjs/diagnostics.md) 0.24.1
- [@lwrjs/shared-utils](https://npm.io/package/@lwrjs/shared-utils.md) 0.24.1
- [http-proxy-middleware](https://npm.io/package/http-proxy-middleware.md) 2.0.10

## Recent versions

- 0.24.1 (latest) — 2026-09-15
- 0.23.22 (summer26) — 2026-09-23
- 0.19.9 (winter26) — 2026-09-15
- 0.22.21 (vanilla) — 2026-09-03
- 0.22.7-alpha.6 (alpha) — 2026-03-02
- 0.21.3 (next) — 2026-01-14
- 0.17.9 (summer25) — 2025-05-20
- 0.15.10 (patch) — 2025-03-28
- 0.13.10 (winter25) — 2024-10-28
- 0.12.4 (summer24) — 2024-06-21
- 0.11.15 (spring24) — 2024-03-01
- 0.23.21 — 2026-09-15
- 0.23.20 — 2026-09-04
- 0.23.19 — 2026-09-02
- 0.22.20 — 2026-09-01
- … 288 more at https://npm.io/package/@lwrjs/dev-proxy-server/versions

## README

# LWR Development Proxy Server

The LWR Development Proxy Server enables LWR applications to reference resources hosted outside of the LWR runtime.

```ascii
                                                                            ┌──────────────┐
                                    ┌────────┐                              │              │
                                    │        │                              │              │
                                    │        │                              │ lwr runtime  │
  https://example.com/home          │        │─────────────────────────────▶│              │
     ──────────────────────────────▶│ site   │   /home                      │              │
   /1/bundle/.../bundle_lwc.js      │  proxy │   /1/bundle/.../bundle_lwc.js└──────────────┘
   /1/asset/.../global.css          │        │   /1/asset/.../global.css
   /content/.../logo-salesforce.svg │        │                                     ┌──────────────┐
                                    │        │                                     │              │
                                    │        │────────────────────────────────────▶│   content    │
                                    │        │   /content/.../logo-salesforce.svg  │   origin     │
                                    └────────┘                                     │              │
                                                                                   │              │
                                                                                   └──────────────┘
```

In production deployments the proxying of distrbuted resources is typically provided by a dedicated service (e.g. Cloudfront, Cloudflare, NginX, etc), seperate from the origin application/UI services.

For local runtime scenarios, the LWR Development Proxy Server provides a simple and integrated local site proxy that can be used when developing, previewing or debugging the site or its built distribution.

## Configuration

To configure the Development Proxy Server add another proxy entry to the `_proxy` runtime configuration file in your projects `config` directory.

```text
/content https://c1.sfdcstatic.com/
```

Each entry of the `_proxy` configuration includes the base `path` of the requests to be proxied to their associated origin host.

## LWR CLI Command support

The Development Proxy Server is integrated into the Lightning Web Runtime CLI commands -- `lwr dev`, `lwr build` and `lwr preview`.

The Development Proxy Server is only started with a site containing a [proxy configuration](#configuration).

### Dev

In `dev` mode, the CLI detects the existence of [proxy configuration](#configuration) in your source `config` directory and starts the local proxy server instance alongside the runtime.

```sh
$ lwr dev
Running LWR Proxy at: http://localhost:3000
Running LWR at: http://localhost:3001 | mode: dev
Application site is available at: http://localhost:3000
```

### Build

When building a site with `lwr build`, the CLI stages any source [proxy configuration](#configuration) into the built distribution alongside the other site runtime resources.

### Preview

Like [Dev](#dev), previewing a site containing a [proxy configuration](#configuration) starts the local proxy server instance alongside the application runtime.

```sh
$ $ lwr preview
Running LWR Proxy at: http://localhost:3000
Running LWR at: http://localhost:3001 | mode: prod-compat
Application site is available at: http://localhost:3000
```

The development proxy server is also enabled for previewing sites built for a specific target (e.g. `mrt`).

```sh
$ lwr preview --target=mrt --buildDir mrt-preview
Running LWR Proxy at: http://localhost:3000
LWR services have been started on: http://localhost:3000
Starting the DevServer on http://localhost:3001
```

---
_Source: https://npm.io/package/@lwrjs/dev-proxy-server · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
