# CORS: Private Network Access preflight blocked (public site calling localhost/intranet)

**Code:** `CORS` · **Category:** HTTP · **Seen on:** HTTP, Browser, Chrome

Chrome blocks a public website from reaching a private IP, localhost or intranet service without explicit permission.

## Meaning

Requests from a public origin to a more private address trigger a PNA preflight with `Access-Control-Request-Private-Network: true`. The server must answer `Access-Control-Allow-Private-Network: true` plus normal CORS headers, and the page must be served over HTTPS.

## Common causes

- Public page calling 192.168.x.x or localhost
- Server not sending Allow-Private-Network
- Mixed content with the private target
- Chrome PNA enforcement enabled
- Device/router API called from the web

## Quick fix

1. Return `Access-Control-Allow-Private-Network: true` on the preflight
2. Serve the page over HTTPS
3. Proxy through a public backend instead

## Detailed fix by platform

### Express

1. `app.options("*", (req, res) => { res.set("Access-Control-Allow-Private-Network", "true"); res.sendStatus(204); });`

## How to diagnose

1. **Target** — Private address?
2. **PNA header** — Returned?
3. **Page** — HTTPS?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/http/cors-private-network-access-blocked)
