- Sending messages --
hub.send()
- Endpoint targets --
hub.local.addStream()
andhub.local.addTarget()
- Hub --
hub = MsgFabric.create()
- Channels and connections --
hub.connect()
- Target Router --
hub.local
- Fabric Router --
hub.router
- Channels and connections --
-
default:
import MsgFabric from "msg-fabric-core"
uses"msg-fabric-core/esm/mf-json.js"
-
core:
import MsgFabric from "msg-fabric-core/esm/mf/core.js"
-
with JSON support:
-
with CBOR support:
-
Transport Codecs:
- JSON:
plugins/json
- CBOR:
plugins/cbor
- JSON:
-
Web platform
plugins/ids/web
plugins/web
for using WebSocket,MessageChannel
,postMessage
, WebRTC, WebWorkers, ServiceWorkers, and iFrames
-
NodeJS platform
plugins/ids/node
plugins/net
for using TCP, TLS, and NodeJS Streams
-
p2p-basic
Provides a basic hello protocol between fabric routers.
-
Discovery (alpha)
Pluggable discovery mechanisms for target endpoints and router connections.
-
Direct connections
Useful for peering multiple MsgFabric hubs
-
RPC (alpha)
An RPC plugin sketch for stateful and idempotent/stateless RPC dispatch.