v151 · Web APIs · Permissions Policy
Permission Policy Merger: direct-sockets-private with local-network and loopback-network
Chrome 151 merges the direct-sockets-private Permissions Policy directive with the local-network and loopback-network directives, consolidating the policy surface for private network socket access.
background
The Direct Sockets API allows Isolated Web Apps (IWAs) to open raw TCP/UDP sockets directly to private network addresses. Previously, three separate Permissions Policy directives controlled access: direct-sockets-private (for private ranges), local-network, and loopback-network.
Chrome 151 merges direct-sockets-private into the local-network and loopback-network directives, reducing the number of headers needed and aligning with the Local Network Access permission model.
concepts
-
Policy Demo
Shows the Permissions Policy headers before and after the merger, and demonstrates feature detection for direct socket access.
-
Migration Guide
How to update existing Permissions Policy headers when migrating from
direct-sockets-privateto the mergedlocal-network/loopback-networkdirectives. -
Policy Header Builder
Toggle which directives to grant and instantly generate the correct
Permissions-Policyheader for both old Chrome (withdirect-sockets-private) and Chrome 151+ (merged intolocal-networkandloopback-network). A live feature detection panel shows which directives are actually allowed on this page. -
Iframe Policy Inspector
An interactive tree of a top frame plus three nested iframes. Toggle the parent
Permissions-Policyheader values, edit each iframe'sallow=""attribute, and watch the effective policy propagate down — visualising how intersection works for each directive. -
Policy Inheritance Explorer
Configure the top-level HTTP header and each nested iframe's
allow=""attribute via dropdowns, then watch the mergeddirect-sockets-privatepolicy flow through a three-level frame tree. A table shows ALLOWED / DENIED per directive at every level. -
Feature Comparison
Four tabbed scenarios (block all, allow self, allow trusted iframe, IWA manifest) each shown side-by-side: the old three-directive syntax versus the new single merged directive. Includes a migration note on backward compatibility.
-
Header Echo Lab
Build a merged Chrome 151 policy, fetch a live route that returns the matching
Permissions-Policyresponse header, and compare it with the transitional header older Chrome versions may still need.
the change
# Before Chrome 151: separate directives
Permissions-Policy: direct-sockets=*, direct-sockets-private=*, local-network=*
# Chrome 151+: direct-sockets-private merged into local-network + loopback-network
# Use these instead:
Permissions-Policy: direct-sockets=*, local-network=*, loopback-network=*
# In JavaScript (Isolated Web Apps only):
const { readable, writable } = await navigator.openTCPSocket({
remoteAddress: '192.168.1.100', // private range
remotePort: 8080,
});
// Requires: local-network policy + IWA context
references
implementation reference
Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗