WebSockets - Switching between ws / wss after connecting?

Is it possible to first establish a ws: // connection (not encrypted SSL), and then after transferring the bit switch to wss: // to the same connection (and vice versa)?

Since WebSockets are long live connections, it seems to me that makes sense. And I really need it in one of my projects ...

+3
source share
1 answer

You cannot switch from unencrypted (ws) to encrypted (wss) in the same socket connection. You can establish two connections from the very beginning and simply do not use encrypted until you are ready if you are concerned about the installation delay. Otherwise, just create a new encrypted session when you are ready.

+2
source

All Articles