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] Transparent DNSLINK #519

Closed
mkg20001 opened this issue Jul 9, 2018 · 6 comments
Closed

[feature request] Transparent DNSLINK #519

mkg20001 opened this issue Jul 9, 2018 · 6 comments

Comments

@mkg20001
Copy link

mkg20001 commented Jul 9, 2018

It would be useful if there would be a "transparent DNSLINK" mode that would serve from the local node gateway without redirecting to localhost.

@lidel
Copy link
Member

lidel commented Jul 10, 2018

@mkg20001 do you mean the situation we have on ipfs.io where there is a public gateway AND dnslink on the same hostname? If that is what you had in mind, check #518 which should make it possible.

If it is something else, could you elaborate on it bit more, give a real life example etc please?

@mkg20001
Copy link
Author

What I mean is for example a user accesses https://somesite.com which has a DNSLINK.
Usually the user would get redirected to http://<local-gateway>/ipns/somesite.com

Would it be possible to make it so the addon intercepts the request, does not redirect it but simply overrides the response with the one for the url the user would get redirected to? (Basically so https://somesite.com is shown in the URL bar, yet the requests get sent to http://<local-gateway>)

@lidel
Copy link
Member

lidel commented Jul 11, 2018

Sadly no, not with current APIs. It is not possible to inject payload into live HTTP sessions. We can either redirect or cancel HTTP requests.

What you are proposing is basically a duplicate of #164 where we track efforts to get ipfs:// be a native handler, not just a redirect to http://
Having that at some point in the future, opening http://foo.bar would detect dnslink and redirect to ip(f|n)s://foo.bar (without mutating paths)

(Feel free to reopen if I misunderstood the case tho)

@lidel lidel closed this as completed Jul 11, 2018
@mkg20001
Copy link
Author

(without mutating paths)

If this means URL bar stays unchanged, yet it loads from local gateway then I think this can be closed.

@ivan386
Copy link

ivan386 commented Jul 12, 2018

You can set local gateway as proxy for URL?

@lidel
Copy link
Member

lidel commented Jul 13, 2018

Key limitation is that browser extension can't act as a Proxy because it can't spoof payloads of HTTP responses (at this time). When it comes to HTTP it can only redirect to a different URL, so an external app needs to act as a proxy.
There may be a custom protocol handler API added to browsers in future, but that won't be http:// in the location bar anymore.

Digression:
If we re-frame this feature as "make go-ipfs' HTTP gateway act as a regular HTTP proxy" and even if go-ipfs could pretend to be a real HTTP Proxy, this abstraction breaks on sites with TLS, especially ones with HSTS.

I think the way dnslink will work in future in browser extension will be an honest redirect from https://foo.bar to ipfs://foo.bar

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

3 participants