hybrid-swarm
Finds peers using client-side browser webrtc connections and node.js.
Usage
var hybrid = // see npmjs.org/webrtc-swarmvar signalhub = 'https://signalhub.mafintosh.com' // see npmjs.org/discovery-swarmvar discovery = ... var swarm = swarm
API
HybridSwarm(opts)
Takes options for signalhub
and discovery
. See example for more information.
HybridSwarm.connections
The number of total connections.
HybridSwarm._connection(conn, opts)
Called when the swarm has found a new connection (or peer).
Arguments:
conn
: connection objectopts
: contains metadata, such as the module/connection type: 'webrtc-swarm' or 'discovery-swarm'
HybridSwarm._listening()
Called when the node swarm is listening.
Example
Used in