Giter Club home page Giter Club logo

Comments (3)

GitforZhangXL avatar GitforZhangXL commented on July 3, 2024 1

全局查找并编辑文件bizwechat.js文件
在第6行的下一行加入以下2行内容,也就是const { pushBearRouter, indexHtml } = require('./pushbear')下面
const https = require('https')
const fs = require('fs')

在第24行的下一行加入以下4行内容,也就是const app = express()下面
const privateKey = fs.readFileSync('/root/.node-red/cert.key')
const certificate = fs.readFileSync('/root/.node-red/cert.pem')
const options = {key: privateKey, cert: certificate}
const httpsServer = https.createServer(options, app)

将下面的内容替换
const server = app.listen(biz_config.port, () => {
node.status({ text: port: ${biz_config.port}, fill: 'green', shape: 'dot' })
node.log(listening on port ${biz_config.port})
})
为如下:
if (biz_config.url.startsWith("https")){
const server = httpsServer.listen(biz_config.port, () => {
node.status({ text: port: ${biz_config.port}, fill: 'green', shape: 'dot' })
node.log(https listening on port ${biz_config.port})
})
}`

else{
const server = app.listen(biz_config.port, () => {
node.status({ text: port: ${biz_config.port}, fill: 'green', shape: 'dot' })
node.log(listening on port ${biz_config.port})
})}

@FlashSoft 是否考虑在下个版本中加入https支持?

from node-red-contrib-bizwechat.

yaming116 avatar yaming116 commented on July 3, 2024

nginx反代即可,没必要程序支持

from node-red-contrib-bizwechat.

zslibra avatar zslibra commented on July 3, 2024

全局查找并编辑文件bizwechat.js文件
在第6行的下一行加入以下2行内容,也就是const { pushBearRouter, indexHtml } = require('./pushbear')下面
const https = require('https')
const fs = require('fs')

在第24行的下一行加入以下4行内容,也就是const app = express()下面
const privateKey = fs.readFileSync('/root/.node-red/cert.key')
const certificate = fs.readFileSync('/root/.node-red/cert.pem')
const options = {key: privateKey, cert: certificate}
const httpsServer = https.createServer(options, app)

将下面的内容替换
const server = app.listen(biz_config.port, () => {
node.status({ text: port: ${biz_config.port}, fill: 'green', shape: 'dot' })
node.log(listening on port ${biz_config.port})
})
为如下:
if (biz_config.url.startsWith("https")){
const server = httpsServer.listen(biz_config.port, () => {
node.status({ text: port: ${biz_config.port}, fill: 'green', shape: 'dot' })
node.log(https listening on port ${biz_config.port})
})
}`

else{
const server = app.listen(biz_config.port, () => {
node.status({ text: port: ${biz_config.port}, fill: 'green', shape: 'dot' })
node.log(listening on port ${biz_config.port})
})}

@FlashSoft 是否考虑在下个版本中加入https支持?

清楚明白,成功使用SSL,非常感谢!
也谢谢yaming116开发出这么好用的插件!

from node-red-contrib-bizwechat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.