nodel spec - museumsvictoria/nodel GitHub Wiki
Simple example
Discovery
Client multicasts†:
{ "discovery": "*", "types": ["tcp", "http"] }
Server replies (unicasts) back:
{ "present": ["Node X", "Node Y", "Node Z"],
"addresses": ["tcp://192.168.2.10:60223", "http://192.168.2.10:8085/nodes/%NODE%/"] }
Connection
Client creates TCP connection to 192.168.2.10:60223
.
Client sends:
{ "node": "Node X",
"actions": [ "Action A", "Action B", "Action C" ],
"events": ["Event R", "Event S", "Event T" ] }
Server confirms with:
{ "node": "Node X",
"actions": [ "Action A", "Action B", "Action C" ],
"events": ["Event R", "Event S", "Event T" ] }
Operation
Client calls Action A:
{ "node": "Node X", "action": "Action A", "arg": 0 }
Clients waits for events...
Server sends:
{ "node": "Node X", "event": "Event R", "arg": true }
{ "node": "Node X", "event": "Event S", "arg": [1, 2, 3] }
Names
See https://github.com/museumsvictoria/nodel/wiki/Simple-names
† By default Nodel uses 224.0.0.252 port 5354