【问题标题】:How to set up socketcluster with SSL如何使用 SSL 设置 socketcluster
【发布时间】:2018-07-16 09:18:17
【问题描述】:

我想在带有 SSL 的专用机器上使用 socketcluster。没有代理或类似的东西。

文档对此相当含糊。甚至可能吗?如何传递key和crt文件?

【问题讨论】:

    标签: socketcluster


    【解决方案1】:

    没关系,算了。发布解决方案以防其他人需要快速提示:

    在 scserver.js 中说 options = { ... } 添加:

      protocol: 'https',
      protocolOptions: {
        key: fs.readFileSync('/path/to/key'),
        cert: fs.readFileSync('/path/to/crt'),
        ca: fs.readFileSync('/path/to/ca/bundle')
      }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-10-08
      • 2021-10-27
      • 1970-01-01
      • 1970-01-01
      • 2022-01-15
      • 2016-10-19
      • 2020-05-31
      • 2018-10-07
      相关资源
      最近更新 更多