As discussed previously (e.g., #16 (comment)) it would be useful to also support a targetAddressSpace option in the WebSocket constructor. This would allow developers using WebSockets to similarly benefit from the mixed content blocking carveout for local network requests that we specified for the Fetch API, and avoid cumbersome workarounds like having end users manually specify local IP addresses.
To accomplish this, we'll need to also add an "options bag" to the WebSocket constructor (proposed in whatwg/websockets#76 and tracked in https://chromestatus.com/feature/5080055102439424 on the Chromium side), and then we can add a new targetAddressSpace key to the WebSocketInit map that takes an IP address space string (for now, I think just specifying the "local" case would suffice, since localhost is already a stable hostname identifier and already exempted from mixed content block by virtue of being considered a secure connection).
I've started PR #125 to draft the spec language necessary for adding this to WebSockets.
As discussed previously (e.g., #16 (comment)) it would be useful to also support a
targetAddressSpaceoption in the WebSocket constructor. This would allow developers using WebSockets to similarly benefit from the mixed content blocking carveout for local network requests that we specified for the Fetch API, and avoid cumbersome workarounds like having end users manually specify local IP addresses.To accomplish this, we'll need to also add an "options bag" to the WebSocket constructor (proposed in whatwg/websockets#76 and tracked in https://chromestatus.com/feature/5080055102439424 on the Chromium side), and then we can add a new
targetAddressSpacekey to theWebSocketInitmap that takes an IP address space string (for now, I think just specifying the "local" case would suffice, sincelocalhostis already a stable hostname identifier and already exempted from mixed content block by virtue of being considered a secure connection).I've started PR #125 to draft the spec language necessary for adding this to WebSockets.