gpt4 book ai didi

javascript - 使用 UWS 和 SSL 设置节点

转载 作者:行者123 更新时间:2023-12-03 03:35:49 25 4
gpt4 key购买 nike

我正在寻找有关如何使用 WWS/SSL 正确配置 UWS 的文档或示例。目前我只是在做:

this.server = new WebSocket.Server({
port: this.config.port,
verifyClient: this.authenticate.bind(this)
});

这显然只是绑定(bind)了一个基本套接字。我是否需要使用设置初始化单独的 https 并将其插入 UWS 选项?

如果是这样,是否仍然利用 SSL 的 UWS 内部结构?我不知道内部结构怎么看起来这么奇怪。

最后一个问题,我可以使用 DH 作为附加密码吗?我是否能够执行类似于设置 Express 服务器的操作?

this.api = express.createServer({
key: config.certs.key,
cert: config.certs.cert,
dhparam: config.certs.dh,
secureOptions: constants.SSL_OP_NO_SSLv3 | constants.SSL_OP_NO_SSLv2
});
this.api.use(helmet.hsts({
maxAge: 31536000000,
includeSubdomains: true,
force: true
}));

谢谢!

最佳答案

Do I need to initialize a separate https with the settings and plug it into the UWS options?

是的。

If so does that still leverage the UWS internals with SSL? I have no idea how the internalized structure looks so just curious.

其中一些。 Specifying the https server ,意味着您won't use the built-in http server .

Last question, can I use DH as an additional cipher? Would I have the ability to do something similar to setting up an Express server?

当然。 express.createServer(或 https.createServer )接受来自 tls.createSecureContext 的选项,其中包括 dhparam

关于javascript - 使用 UWS 和 SSL 设置节点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45863747/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com