当前位置

网站首页> 程序设计 > 开源项目 > 程序开发 > 浏览文章

Meshblu创建coapServer

作者:小梦 来源: 网络 时间: 2024-08-06 阅读:

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

相关阅读

热点阅读

网友最爱