Intent to Prototype: Support targetAddressSpace option for WebSockets

9 views
Skip to first unread message

Chromestatus

unread,
4:26 PM (1 hour ago) 4:26 PM
to blin...@chromium.org, cth...@chromium.org
Contact emails
cth...@chromium.org

Explainer
https://github.com/WICG/local-network-access/issues/126

Specification
https://github.com/WICG/local-network-access/pull/125

Summary
Add support for passing a targetAddressSpace option in the WebSocket constructor. This allows developers to specify that a WebSocket connection to a public hostname should be treated as going to a "local" or "loopback" destination, matching the existing support on the Fetch API. The main use case is to offer an escape hatch to bypass mixed content restrictions for connecting to local servers that cannot yet support HTTPS (as Local Network Access permissions require a secure context). Example: A public site that connects to a local server can use a hostname to avoid needing manual configuration of the exact private IP address in use: `const ws = new WebSocket("ws://local-server.example", { targetAddressSpace: "local"}` This will flag the WebSocket connection as going to a local address, bypassing mixed content blocking when run in a secure context. The user must grant the site the local network permission for the WebSocket connection to succeed, and the hostname must resolve to a local IP address (otherwise it will be blocked). This builds on https://chromestatus.com/feature/5080055102439424 which adds an options bag to the WebSocket constructor.

Blink component
Blink>Network>WebSockets

Web Feature ID
local-network-access

Motivation
To avoid mixed content blocking for local network WebSockets requests, web developers have relied on having their users manually configure their local network IP addresses, which is awkward at best. Adding support for the targetAddressSpace option in WebSockets aligns it with the Fetch API. This has also been requested by developers (e.g., https://github.com/WICG/local-network-access/issues/16#issuecomment-4459071272).

Initial public proposal
https://github.com/WICG/local-network-access/issues/126

Goals for experimentation
None

Requires code in //chrome?
False

Tracking bug
https://crbug.com/517413738

Estimated milestones

No milestones specified



Link to entry on the Chrome Platform Status
https://chromestatus.com/feature/4779920606756864?gate=6029507826941952

This intent message was generated by Chrome Platform Status.
Reply all
Reply to author
Forward
0 new messages