Skip to content

Latest commit

 

History

History
 
 

webrtc-star-signalling-server

js-libp2p-webrtc-star-signalling-server

Discourse posts Build Status Dependency Status js-standard-style

A webrtc-star signalling server that allows peer discovery between browsers

Table of Contents

Description

Nodes using the libp2p-webrtc-star transport will connect to a known point in the network, a rendezvous point where they can learn about other nodes (Discovery) and exchange their SDP offers (signalling data).

Install

> npm install -g @libp2p/webrtc-star-signalling-server

Usage

To start a server run:

$ webrtc-star --port=13579 --host=127.0.0.1

Defaults:

  • port - 9090
  • host - '0.0.0.0'

Or in JavaScript:

import { signallingServer } from '@libp2p/webrtc-star-signalling-server'

const server = await signallingServer({
  port: 24642,
  host: '0.0.0.0',
  metrics: false
})

// some time later
await server.stop()

Hosted Rendezvous Server

We host signaling servers at wrtc-star1.par.dwebops.pub and wrtc-star2.sjc.dwebops.pub, that can be used for practical demos and experimentation, it should not be used for apps in production. Check Deployment.md for how to deploy your own server.

A libp2p-webrtc-star address, using the signalling server we provide, looks like:

/dns4/wrtc-star1.par.dwebops.pub/tcp/443/wss/p2p-webrtc-star/p2p/<your-peer-id>

Note: The address above indicates WebSockets Secure, which can be accessed from both http and https.