Js-ipfs: FlyWeb

Created on 16 Nov 2016  路  16Comments  路  Source: ipfs/js-ipfs

Hello, would something like FlyWeb and js-ipfs make it possible to create a local-ipfs-gateway-in-a-web-page? Or a more general question, does this project or another like it address this issue: it seems that requiring the user to install a local server blocks most potential users and gateways defeat the main purpose by routing all traffic through specific traditional servers. (Or can the core problem of IPFS deployment be solved by socially engineering advocates within key groups like browser and operating systems teams.)

Thanks for giving my question a chance and thanks for your time.

P2 exploration statuready

Most helpful comment

libdweb: mDNS Local Discovery and TCP Transport

FlyWeb core is reused by libdweb for TCP Socket API.
Discovery and transport poc using this API was created by @alanshaw in
https://github.com/ipfs-shipyard/ipfs-companion/pull/553:

Video demo: _libdweb MDNS discovery for JS IPFS running in a web extension_
https://www.youtube.com/watch?v=FRzyWUXIyeo
screenshot_9

libdweb: Streaming Protocol Handler

Protocol Handler API poc implementation of ipfs:// and ipns:// is in https://github.com/ipfs-shipyard/ipfs-companion/pull/533 (AFAIK not related to FlyWeb, but mentioning here for completeness)

Video demo: _Protocol Handler Demo with libdweb and Firefox Nightly_
https://www.youtube.com/watch?v=fS8pLOQdOoM
Lab Day 2018 // Protocol Handler Demo with libdweb and Firefox Nightly

All 16 comments

local-ipfs-gateway-in-a-web-page

Not sure what the use case is here, to run a IPFS gateway in a web page? Not sure why you would like to do that, since you can just fetch the objects directly with js-ipfs in the page, instead of having a gateway.

I don't think I'm understanding your question good enough to give a proper answer.

I thought I described it in enough detail. Either I don't understand IPFS/js-ipfs or I was just wasting my time anyway. Whatever.

Hey @runvnc, what @VictorBjelkholm was bringing up is that running an IPFS gateway, also known as the HTTP-API that gets exposed when an IPFS daemon is running, is not possible since you can't have a spawn an http server inside the browser.

What you can do directly, is use js-ipfs as a "gateway" to the entire IPFS network, because js-ipfs is a full IPFS node :)

FlyWeb is an HTTP server in Firefox. If it were used to make a gateway then other IPFS sites that don't know about js-ipfs would be accessible.

@runvnc yeah this use case is a good idea, and i've discussed it with some as Mozilla worked on, and released FlyWeb. Yes, we should be able to make an ipfs http gateway with it, to interact with non-ipfs devices locally. Expanding your questions, i think you're asking:

  • Does the js-ipfs implementation include the http-to-ipfs gateway that go-ipfs has?
  • If so, where can i find an example of its usage?
  • And, have you tried using it with FlyWeb, to expose IPFS content with a local gateway? That's what I'm aiming for.

Assuming that,

  • Does the js-ipfs implementation include the http-to-ipfs gateway that go-ipfs has?

I believe not yet? But i think @diasdavid plans for it to be there eventually. @diasdavid thoughts? There's a listing of "commands implemented in js-ipfs to reach go-ipfs parity" somewhere, thought in the readme of this repo, but i can't find it right now.

The point though is to port this part of go-ipfs: https://github.com/ipfs/go-ipfs/tree/master/core/corehttp which is being extracted to https://github.com/ipfs/go-ipfs-gateway soon. (i think @lgierth is up to that)

If you want to try something mad-sciency, can ask @lgierth and @whyrusleeping if the go-ipfs http-to-ipfs gateway is independent enough to try something like a gopherjs-ed thing on top of js-ipfs. I recently have been very impressed by gopherjs -- even if its payloads happen to include the entire go runtime >.<

  • If so, where can i find an example of its usage?

Not yet there, i think.

  • And, have you tried using it with FlyWeb, to expose IPFS content with a local gateway? That's what I'm aiming for.

Yes, i really want this, and want to support this use case. How serious are you about pursuing this? this is something i'd be willing to throw resources into in the near term. (considering putting a bounty on it)

I think this is worth reopening, until we have a plan of action.

@jbenet thanks, was starting to think I was crazy. Unfortunately I don't think I have the time right now because of other obligations. I mainly wanted to mention the idea because I saw FlyWeb and wondered if it could help with distributed computing in some way.

It seems like any dev who is interested in FlyWeb and not too busy would quite possibly be excited about this use case, especially if there was a bounty.

So I know that questions don't actually solve problems but can't help but ask one more. Does anyone know if/when Chrome people will start on something like FlyWeb?

I believe not yet? But i think @diasdavid plans for it to be there eventually. @diasdavid thoughts? There's a listing of "commands implemented in js-ipfs to reach go-ipfs parity" somewhere, thought in the readme of this repo, but i can't find it right now.

We do support the HTTP-API, which enables us to tests like benchmarks and sharding from go-ipfs. I believe the list you are looking for is this one: https://github.com/ipfs/js-ipfs/blob/master/ROADMAP.md#project-status

You can even use js-ipfs-api to contact js-ipfs through its http-api implementation :)

@diasdavid So, is it possible to start HTTP gateway using API for js-ipfs node created through API in node.js?

@harshjv absolutely, see my comment in your other issue: https://github.com/ipfs/js-ipfs/issues/693

I've brought up FlyWeb again, but for local peer discovery: https://github.com/ipfs/in-web-browsers/issues/45

Pinging the FlyWeb team @kannanvijayan, @justindarc and @sicking.

Hi FlyWeb team o/, my apologies for spamming directly your Github notifications inbox. We would like to develop a PoC of js-ipfs in the browser using FlyWeb's service discovery API.

Currently, js-ipfs works in the browser, both Chrome and Firefox and we also have an HTTP API and client libraries that developers are familiar, we could expose a http transport for js-ipfs through FlyWeb or use it to find the node in some other tab.

What's the current state of FlyWeb and its current dev roadmap? When can we expect to see it on a regular release of Firefox?

Thanks in advance!

@lgierth @VictorBjelkholm could you please document in this issue your recent experiments? Thank you :)

There is now a experimental effort from mozilla to support many of our wanted APIs, mdns is one of them! Issue is here: https://github.com/mozilla/libdweb/issues/7

@alanshaw @lidel can you post here all the demos and talks on libdweb so far to this thread?

libdweb: mDNS Local Discovery and TCP Transport

FlyWeb core is reused by libdweb for TCP Socket API.
Discovery and transport poc using this API was created by @alanshaw in
https://github.com/ipfs-shipyard/ipfs-companion/pull/553:

Video demo: _libdweb MDNS discovery for JS IPFS running in a web extension_
https://www.youtube.com/watch?v=FRzyWUXIyeo
screenshot_9

libdweb: Streaming Protocol Handler

Protocol Handler API poc implementation of ipfs:// and ipns:// is in https://github.com/ipfs-shipyard/ipfs-companion/pull/533 (AFAIK not related to FlyWeb, but mentioning here for completeness)

Video demo: _Protocol Handler Demo with libdweb and Firefox Nightly_
https://www.youtube.com/watch?v=fS8pLOQdOoM
Lab Day 2018 // Protocol Handler Demo with libdweb and Firefox Nightly

Was this page helpful?
0 / 5 - 0 ratings

Related issues

OliverUv picture OliverUv  路  3Comments

Ntmf picture Ntmf  路  4Comments

beingmohit picture beingmohit  路  3Comments

daviddias picture daviddias  路  3Comments

daviddias picture daviddias  路  3Comments