Start with --cors
The flag gives you working defaults so you can unblock a frontend in seconds.
Running local-proxy from a browser on a different origin — the typical dev setup with frontend on localhost:3000 and proxy on localhost:5050 — triggers CORS. Enable handling in one of two ways.
Permissive defaults, ideal for quick dev:
local-proxy --target https://api.example.com --corscors block in scenarios.jsonFine-grained control:
{ "cors": { "enabled": true, "origin": "auto", "credentials": true, "allowedHeaders": "auto", "allowedMethods": ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"], "exposedHeaders": ["X-Total-Count"], "maxAge": 86400 }, "rules": []}enabled (boolean, default false): turn CORS handling onorigin ("auto" | string | string[], default "auto"): "auto" reflects the request Origin; an array allowlists specific originscredentials (boolean, default true): sets Access-Control-Allow-Credentials: trueallowedHeaders ("auto" | string[], default "auto"): "auto" echoes the preflight Access-Control-Request-HeadersallowedMethods (string[], default ["GET","POST","PUT","PATCH","DELETE","OPTIONS"]): methods returned on preflightexposedHeaders (string[], optional): headers exposed to JS via Access-Control-Expose-HeadersmaxAge (number, default 86400): preflight cache seconds--cors forces enabled: true regardless of the scenarios file; other fields in the cors block still apply. When CORS is on:
OPTIONS requests are short-circuited with 204Start with --cors
The flag gives you working defaults so you can unblock a frontend in seconds.
Allowlist origins for shared envs
Use origin: ["http://localhost:3000", "http://localhost:4200"] instead of "auto" when multiple apps hit the same proxy.
Expose custom headers
Set exposedHeaders (for example ["X-Total-Count"]) so frontend code can read them via fetch.