How to secure WebSocket connections with TLS/SSL (HTML)
This topic explains how to secure WebSocket connections with Transport Layer Security (TLS)/Secure Sockets Layer (SSL) when using the StreamWebSocket and MessageWebSocket features in a Windows Runtime app.
In most cases you'll want to use a secure WebSocket connection. This will increase the chances that your connection will succeed, as many proxies will reject unencrypted WebSocket connections.
Enables network communications using sockets and WebSockets.
The WebSocket Protocol defines two URI schemes. ws: is used for unencrypted connections, while wss: is used for secure connections that should be encrypted.
- To encrypt your connection, use the wss: URI scheme. For example:
For additional details on the WebSocket URI schemes, see the WebSocket Protocol.
- Connecting with WebSockets
- How to connect with a MessageWebSocket
- How to connect with a StreamWebSocket
- WebSocket sample