libp2p / go-libp2p-webrtc-direct

A libp2p transport that enables browser-to-server, and server-to-server, direct communication over WebRTC without requiring signalling servers
MIT License
82 stars 18 forks source link

Add JS equivalent of libp2p-echo example #17

Open backkem opened 5 years ago

backkem commented 5 years ago

Add JS equivalent of libp2p-echo example to show off compatibility.

tobowers commented 5 years ago

Is there any example for adding the js to a libp2p node? I'm getting invalid multiaddr from bootstrap

backkem commented 5 years ago

Hi @tobowers, I'm not all to familiar with js-libp2p. Maybe @vasco-santos can help us out with setting up a compatibility test.

tobowers commented 5 years ago

Would really love this - I'm seeing a lot of errors trying to get the two to talk.

tobowers commented 5 years ago

fwiw - I don't think the current code works with libp2p, at least browser? However, getting rid of all the internal mux here and switching it around to use the transport.Upgrader has seemed to work.

backkem commented 5 years ago

There is a lower level integration test between the JavaScript and Go variant in examples/standalone. I'm not sure why it would not work when plugged into libp2p.

FYI, pion/webrtc supports compiling to WASM. One thing the 0x guys have been trying is to run go-libp2p both naively and in the browser using WASM. That way you only need one codebase. This effort isn't complete thought.