Skip to content
This repository has been archived by the owner on Jan 20, 2023. It is now read-only.

Default to global ipfs API #10

Closed
danfinlay opened this issue Sep 9, 2018 · 1 comment
Closed

Default to global ipfs API #10

danfinlay opened this issue Sep 9, 2018 · 1 comment
Labels
kind/enhancement A net-new feature or an improvement to an existing feature kind/question A question or request for support

Comments

@danfinlay
Copy link

The ipfs companion browser extension allows a user to provide a web API to any site that draws data from the user's own IPFS client preference.

When loading the IPFS gateway, it would be cool if the site first checked if the user's browser had a window.ipfs object, as provided by the ipfs companion, and defaulted to loading content from it.

This would reduce load on the gateway when visited by companion users, and would also allow links to ipfs gateways to serve as links to ipfs-browser-users' own local caches.

It's no ipfs://, but it would be a lot easier to make happen.

@Stebalien
Copy link
Member

The IPFS companion can already redirect requests from https://ipfs.io to http://localhost:8080.

We also have a js based gateway (currently hosted at https://js.ipfs.io) that installs a service worker that, in turn, uses js-ipfs. See: https://github.com/ipfs-shipyard/service-worker-gateway. It may also be possible to get the IPFS companion to install this service worker on-behalf-of https://ipfs.io (to redirect all requests to the extension transparently). We don't have this setup on ipfs.io by default mostly because it's still experimental (and js-ipfs has some significant performance issues).

Take a look at ipfs/ipfs-companion#248 and the related issue.


Unfortunately, the go-ipfs gateway can't really do any of this itself as it's just an HTTP gateway and is expected to serve resources to arbitrary HTTP clients (it can't assume that it's just being used to serve websites).

Closing for tracking purposes as this is more of a ipfs-companion issue than a go-ipfs issue. Feel free to ask followup questions.

@Stebalien Stebalien added kind/enhancement A net-new feature or an improvement to an existing feature kind/question A question or request for support labels Sep 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/enhancement A net-new feature or an improvement to an existing feature kind/question A question or request for support
Projects
None yet
Development

No branches or pull requests

2 participants