libp2p / js-libp2p-websocket-star

libp2p-webrtc-star without webrtc. Just plain socket.io.
https://libp2p.io
39 stars 15 forks source link

Upgrade to using /ws and /p2p-circuit #36

Open ghost opened 6 years ago

ghost commented 6 years ago

Currently the rendezvous server is a bandwidth bottleneck by design -- all peer connections go through it, and we unfortunately can't add more instances without making the server capable of federating with other servers, at which point we'd be rebuilding parts of libp2p, outside of libp2p.

We can get the same functionality without the server-relay component, where p2p-websocket-star would do only discovery (and for backwards compatibility, the transport would transparently use a relay.)

Imagine a very simple scenario with three browser nodes QmA, QmB, QmC, and one relay node QmRelay. To each new browser node, the rendezvous server emits addresses of already present nodes:

We should already be capable of exactly this ^ right? @dryajov

For backwards compatibility, the /p2p-websocket-star transport would transparently make use of the /wss and /p2p-circuit transports. It'd basically transform a currently used address like /dns4/ws-star.discovery.libp2p.io/tcp/443/wss/ipfs/QmA to another as shown above.

daviddias commented 6 years ago

@Steverman you did a great job with https://github.com/libp2p/js-libp2p-webrtc-star/pull/130, wanna tackle this one here too?

Steverman commented 6 years ago

I can't promise on this one. Very busy this month (this includes December).

I was not satisfied with my other PR, so I may have to revisit it at some point.

dryajov commented 6 years ago

@lgierth I missed this issue somehow.

To your question, yes, we should be able to emit /p2p-circuit addrs, at which point, it's possible to dial those nodes over the relay.

mkg20001 commented 6 years ago

PR #43