Meshblu创建coapServer
config.js
module.exports = { coap: { port: 5683, host: "localhost" }};
coapServer.js
require('coffee-script/register');var config = require('./config');process.stdout.write('Starting CoAP...');var coapServer = require('./lib/coapServer')(config);console.log(' done.');
此时用Firefox的Copper,访问coap://127.0.0.1:5683/
,进行ping测试。
(注:Copper访问`coap://localhost:5683/,不能解析)
coapServer
必须有config
参数,lib/coapServer.js
中的代码有bug,没有config
参数时会报错