Experimental IPFS Gateway implemented in Service Worker
Decentralizing IPFS Gateways by verifying hashes in the user's browser.
This project demonstrates
the use of Helia (IPFS implementation in JS)
and the verified-fetch
library
(Fetch API for IPFS)
within a Service Worker
to facilitate direct verified retrieval of content-addressed data.
A Service Worker is registered on the initial page load, and then intercepts HTTP requests
for content stored on IPFS paths such as /ipfs/*
(immutable) and
/ipns/*
(mutable) and returns
Response
objects
to the browser.
It functions as an IPFS gateway within the browser, offering enhanced security (hash verification happens on end user's machine) and reliability (ability to use multiple sources of content-addressed blocks) without reliance on a single HTTP server for IPFS tasks.
The main goals of this project are:
index.html
, web pathing, _redirects
)./routing/v1
) client for discovering additional direct content providers.You can build and run the project locally:
> npm ci
> npm start
Now open your browser at http://sw.localhost:3000
As you type in a content path, you will be redirected to appropriate URL (typically that means subdomain style resolution).
For more information about local development setup, see /docs/DEVELOPMENT.md.
main
branchThis project is dual-licensed under
SPDX-License-Identifier: Apache-2.0 OR MIT
See LICENSE for more details.