简体   繁体   中英

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. However, there doesn't seem to be a lot of information about encrypted websocket communication using TLS and the wss:// handler. In fact the only server that I've seen explicitly support wss:// is Kaazing.

This TODO is the only reference I've been able to find in the various node implementations. Am I missing something or are the websocket js servers not ready for encrypted communication yet?

Another option could be using something like lighttpd or apache to proxy to a node listener, has anyone had success there?

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

Well you have stream.setSecure() and 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.

Using TLS in the normal http server object should theorically also secure the websocket, only by testing this can be confirmed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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