Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nickkolok opened this issue Aug 14, 2016 · 4 comments
Open

Comments

@nickkolok
Copy link

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
Copy link

lidel commented Aug 16, 2016

There were related discussions about this:

Practical gist:

  • it is already possible to add DNS TXT record with dnslink that provides a hint for addon that a domain can be loaded from IPFS (Recognize IPFS gateways on arbitrary websites ipfs/notes#92 (comment))
  • browser add-on can query go-ipfs API for a specific domain
    • it is a good idea to cache response for a domain for performance reasons
    • addon checks dnslink cache first (if not present, asks API) and sees if asset requests from a specific domain can be redirected to ipfs

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
Copy link

jes commented May 10, 2017

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
Copy link

lidel commented May 10, 2017

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants