2017-09-13 27 views

回答

0

你並不需要更換節點(我不相信有任何因爲它需要實例化它的獨立節點RED自己的HTTPS服務器),你只需配置節點-RED偵聽HTTPS連接。

如何配置Node-RED在HTTPS上進行偵聽的方法是在settings.js(在Node-RED用戶目錄中找到,通常爲〜/ .node-red,幷包含在Node-RED的前幾行中日誌)

// The `https` setting requires the `fs` module. Uncomment the following 
// to make it available: 
//var fs = require("fs"); 
... 
// The following property can be used to enable HTTPS 
// See http://nodejs.org/api/https.html#https_https_createserver_options_requestlistener 
// for details on its contents. 
// See the comment at the top of this file on how to load the `fs` module used by 
// this setting. 
// 
//https: { 
// key: fs.readFileSync('privatekey.pem'), 
// cert: fs.readFileSync('certificate.pem') 
//}, 
... 

更多細節可以在我的博客文章中找到here