libp2p-webrtc-star without webrtc. Just WebSockets with a relay point in the middle.
libp2p-websocket-star is one of the multiple transports available for libp2p.
libp2p-websocket-star incorporates both a transport and a discovery service that is facilitated by the rendezvous server, also available in this repo and module.
> npm install libp2p-websocket-star
Peer Discovery -
const libp2p =const Id =const Info =const multiaddr =const pull =const WSStar =Id
hello hello from the other side
To reduce dependencies
libp2p-websocket-star comes without the rendezvous server, that means that you need to install
libp2p-websocket-star-rendezvous to start a rendezvous server. To do that, first install the module globally in your machine with:
> npm install --global libp2p-websocket-star-rendezvous
This will install a
rendezvous CLI tool. Now you can spawn the server with:
> rendezvous --port=9090 --host=127.0.0.1
Hosted Rendezvous server
We host a rendezvous server at
/dns4/ws-star.discovery.libp2p.io that can be used for practical demos and experimentation, it should not be used for apps in production.
A libp2p-websocket-star address, using the signalling server we provide, looks like:
Note: The address above indicates WebSockets Secure, which can be accessed from both http and https.