peer-base / peer-pad

📝 Online editor providing collaborative editing in really real-time using CRDTs and IPFS.
https://peerpad.net
MIT License
678 stars 58 forks source link

support stream through IPFS daemon #285

Open pgte opened 5 years ago

pgte commented 5 years ago

One of the reasons why we were not able to use an IPFS daemon instead of an embedded js-ipfs node was because go-ipfs didn't allow for p2p streams. But go-ipfs now it does have the p2p command which opens a duplex stream.

(/cc @whyrusleeping)

parkan commented 5 years ago

for clarity, this would work through companion, correct?

pgte commented 5 years ago

Apparently js-ipfs does not support this, so I think companion doesn't either. Opened respective issue on js-ipfs for clarification.

whyrusleeping commented 5 years ago

Cc @magik6k (the author of these features on the go side)

magik6k commented 5 years ago

So go-ipfs exposes libp2p streams via ipfs p2p for quite a while already, but it's not really useful for browsers since it requires use of native sockets.

There was some discussion on creating a websocket interface to these commands to enable browsers to open/listen for p2p streams, but iirc the conclusion was to focus on https://github.com/libp2p/go-libp2p-daemon, and just support websockets there

magik6k commented 5 years ago

(AFAIK it should be possible to implement on the extension level, cc @lidel)

pgte commented 5 years ago

@magik6k ha, thanks for the feedback! If it's not websockets we can't use it directly in the browser context, and we would need this to be in the IPFS daemon..