简体   繁体   English

Node.js和wss://

[英]Node.js and wss://

I'm looking to start using javascript on the server, most likely with node.js, as well as use websockets to communicate with clients. 我希望开始在服务器上使用javascript,最有可能使用node.js,以及使用websockets与客户端进行通信。 However, there doesn't seem to be a lot of information about encrypted websocket communication using TLS and the wss:// handler. 但是,似乎没有很多关于使用TLS和wss://处理程序的加密websocket通信的信息。 In fact the only server that I've seen explicitly support wss:// is Kaazing. 事实上,我见过的唯一明确支持wss://的服务器是Kaazing。

This TODO is the only reference I've been able to find in the various node implementations. 这个 TODO是我在各种节点实现中能够找到的唯一参考。 Am I missing something or are the websocket js servers not ready for encrypted communication yet? 我错过了什么或者websocket js服务器还没有为加密通信做好准备了吗?

Another option could be using something like lighttpd or apache to proxy to a node listener, has anyone had success there? 另一种选择可能是使用像lighttpdapache这样的代理来代理节点监听器,有人在那里取得了成功吗?

TLS / SSL支持适用于Node.js中的这个websocket实现,我刚测试它: https//github.com/Worlize/WebSocket-Node/issues/29

Well you have stream.setSecure() and server.setSecure() . 你有stream.setSecure()server.setSecure()

I'm guessing you should be able to use one of those (specially the last one) to use TLS in websockets since in the end a websocket is just a normal http connection "upgraded" to websocket. 我猜你应该能够使用其中一个(特别是最后一个)在websockets中使用TLS,因为最后websocket只是一个普通的http连接“升级”到websocket。

Using TLS in the normal http server object should theorically also secure the websocket, only by testing this can be confirmed. 在正常的http服务器对象中使用TLS理论上也应该保护websocket,只有通过测试才能确认。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM