Act as HTTP PROXY for http://<cidv1b32>.ipfs.localhost #1877
Description
This is the same feature as ipfs/kubo#5982 (see detailed description and discussion there first)
Problem
CID-in-subdomain creates Origin-based isolation if website is loaded from public gateway:
..however we continue to have a single Origin for all websites loaded from local gateway:
This means use of local gateway decreases some of security guarantees web developers are used to, and removes some incentives to run local go-ipfs (and redirect to it via ipfs-companion).
Solution
What if js-ipfs could act as HTTP PROXY for requests made to http://*.ipfs.*/
and http://*.ipns.*/
?
Having that, IPFS Companion could automatically set Gateway port as PROXY for requests to http://*.ipfs.localhost
, which would create very nice URLs for local gateway, solving the Origin problem for local go-ipfs 👌
Initial look at technical feasibility
See ipfs/kubo#5982 for notes on language-agnostic protocol details.
I did not look into js-ipfs nuances yet (such as how to make it work with Hapi.js)
Would love to hear ideas in comments below.
Rationale for doing this in JS IPFS
This would not only be used in jsipfs daemon
running in Node, but also in Brave and other browsers that allow ipfs-companion access to chrome.sockets.* APIs (or similar).
cc #1440, https://github.com/ipfs/ipfs/issues/337, ipfs/in-web-browsers#89, ipfs/ipfs-companion#667, ipfs/in-web-browsers#109, brave/brave-browser#819