libp2p-websocket-star
libp2p-webrtc-star without webrtc. Just WebSockets with a relay point in the middle.
Lead Maintainer
Description
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.
Usage
Example
TODO
Install
> npm install libp2p-websocket-star
API
Transport
Connection
ws.discovery
Peer Discovery -
Example
const libp2p = const Id = const Info = const multiaddr = const pull = const WSStar = Id
Outputs:
hello
hello from the other side
Rendezvous server
Usage
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
Defaults:
port
- 13579host
- '0.0.0.0'
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:
/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star/ipfs/<your-peer-id>
Note: The address above indicates WebSockets Secure, which can be accessed from both http and https.
LICENSE MIT