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参数时会报错

你可能感兴趣的:(meshblu)