1.0.2 • Published 1 year ago
bajo-udp v1.0.2
bajo-udp
Plugin name: bajoUdp, alias: udp
Attention: I do NOT accept any pull request at the moment, thanks!
UDP binding for Bajo. If Bajo Emitter is loaded, events & messages are also handled through Bajo Emitter processing system.
Installation
Goto your <bajo-base-dir> and type:
$ npm install bajo-udpNow open your <bajo-data-dir>/config/.plugins and put bajo-udp in it
. Order doesn't matter here, but you should put it below bajo-emitter:
...
bajo-emitter
bajo-udp
...Configuration
Open/create <bajo-data-dir>/config/bajoUdp.json:
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
connections | array | no | [] | Define one or more connections |
name | string | no | default | Connection name, must be unique among all your connections |
host | string | yes | 0.0.0.0 | IP or hostname, e.g: mqtt://localhost |
port | integer | yes | Port number to bind to |
Example:
{
"connections": [{
"name": "local",
"host": "0.0.0.0",
"port": 10000
}]
}Hook
bajoUdp:onClose (conn)bajoUdp:onError (conn, error)bajoUdp:onListening (conn)bajoUdp:onMessage (conn, message)