Meshblu建立coapServer

config.js測試

module.exports = {

  coap: {
    port: 5683,
    host: "localhost"
  }

};

coapServer.jsui

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/,不能解析)code

coapServer必須有config參數,lib/coapServer.js中的代碼有bug,沒有config參數時會報錯ip

相關文章
相關標籤/搜索