Open nickkolok opened 8 years ago
There were related discussions about this:
Practical gist:
Yes, it is more complex than agreeing on a specific sub-domain, but it is already supported by go-ipfsm and works for ANY domain.
This might also want to work for arbitrary gateway URLs, completely separate to dnslink.
E.g. I run a public gateway at https://ipfs.jes.xxx - why don't we just intercept any URL that looks like an IPFS URL, regardless of hostname? Specifically, it begins with "/ipfs/$hash" or "/ipns/$hash".
And, furthermore, http://ipfs.io/ works as an ipfs gateway just as well as gateway.ipfs.io does, but this extension doesn't know about it so doesn't redirect it.
why don't we just intercept any URL that looks like an IPFS URL, regardless of hostname?
Short guess: we need to benchmark it first.
There is a risk that validating every URL via is-ipfs will impact browser performance / user experience, just like dnslink
lookups did in Firefox addon.
That is why dnslink
lookups are disabled by default in Firefox, and is-ipfs
validation is limited to arbitrary list of known public gateways.
FWIW Chrome does allow matching paths so the performance impact would be pretty limited and not as bad as the dns redirects https://developer.chrome.com/extensions/match_patterns
Let's imagine that a quite big site wants to partially migrate to ipfs (first of all, pics and scripts). Now it means that the site's owner should use links to
gateway.ipfs.io
. So, ifgateway.ipfs.io
is down or infected, the big site would suffer.I think that it would be a good idea to redirect all
gateway.ipfs.*
subdomains of all domains to ipfs daemon.