It is a biolerplate for writing a simple WebSocket broker server. simple-websocket-broker is a WebSocket broker (channel) server for IoT devices. It aims to help makers making Internet of Personal Things.
- Download simple-websocket-broker.
- Run
$ cd simple-websocket-broker
to change the directory. - Run
$ npm install
to install the dependencies if you don't already have them. - Run
$ node index.js
to start the broker server.
Please try ws://wot.city
at WoT.City first before you start your own IoT cloud.
- Node.js. Note: Node should be with a version above 0.10.x.
To send the data over the Internet, IoT devices should use the url below to establish a connection with the server.
ws://[hostname]/object/[name]/send
You must specify an object name and your hostname. For example:
ws://wot.city/object/554785c7173b2e5563000007/send
To receive data from the server, the frontend should use the url below to establish a connection with the server.
ws://[hostname]/object/[name]/viewer
Also, you need to specify the object name and hostname. For example:
ws://wot.city/object/554785c7173b2e5563000007/viewer
An physical object has two significant resources, send and viewer. send is to send device data to WoT.City, and WoT.City receives data streams over Websocket connection. viewer is used by frontend to receive real-time data over the connection.
dotcity-websocket-broker is a broker that it receives sensor data over Websocket connection and routes data streams to frontend Websocket clients.
There are various ways to get involved with Simple Websocket Broker. We're looking for help identifying bugs, writing documentation and contributing codes.
Most of the Simple Websocket Broker developers, users and contributors are at WeChat group or IRC channel. You can find us in the #wotcity IRC channel on irc.freenode.net. You can get information of how to join WeChat group at #wotcity.
Bugs are reported via https://github.com/wotcity/simple-websocket-broker.
Apache License