dylanPowers / ipfs-chrome-extension

Access gateway.ipfs.io urls the way they were meant: from your locally running ipfs daemon
BSD 3-Clause "New" or "Revised" License
69 stars 9 forks source link

[feature request] gateway.ipfs.* subdomain redirect for any domain #12

Open nickkolok opened 8 years ago

nickkolok commented 8 years ago

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, if gateway.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.

lidel commented 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.

jes commented 7 years ago

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.

lidel commented 7 years ago

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.

dylanPowers commented 7 years ago

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