A light weight library that makes REST-style RPC operations over the Websocket
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE.md
README.md
broker.js
index.js
message.js
node.js
requestHandlers.js
router.js

README.md

wwRPC (aka web-to-web RPC) is a light weight library in JavaScript that makes RPC calls in REST-style operations over the Websocket. wwwRPC is a sub-project of WoT.City and the technical details can be found at WoT.City white paper

wwRPC: web-to-web RPC

wwRPC uses REST-style RPC operations over the WebSocket in IoT devices. The wwRPC aims to help IoT devices to make REST-style RPC calls. In addition, it is the underlying component of WoT.City software framework that can be accordingly used in a peer-to-peer IoT network.

API

rpc = new RPC(from, to)

Create a new wwRPC instance.

  • from is the URI of the sender, for example ws://wot.city/object/2fc89af
  • to is the URI of the receiver, for example ws://wot.city/object/2fc89af/send

rpc.send(message)

Send a RPC message. message must be serialized before sending.

rpc.serialize(message)

Serializ a RPC message.

rpc.deserialize(message)

Deserialize a RPC message.