Create CSP Trusted Sites to Use WebSocket Connections
To configure a WebSocket connection, add a CSP Trusted Site that uses
the secure wss protocol. The insecure ws protocol isn't supported.
Where: This change applies to orgs with Lightning components in Lightning Experience, Lightning Communities, Salesforce Classic, and all versions of the Salesforce app.
Why: The WebSocket API is a web standard for two-way communication between a user's browser and an external server. With this API, you can send messages to a server and receive event-driven responses without having to poll the server for a reply.
How: A sample URL for a WebSocket connection in a CSP Trusted Site is:
wss://example.com/socketserver