Forum Discussion
Can we use web sockets in custom visual?
- 8 months ago
Hi swamisharma,
The issue here is Power BI custom visuals run in a sandboxed environment with strict CSP rules and Your WebSocket connection to wss://echo.websocket.org/ is being blocked because:
- The CSP directive only allows connections to specific domains Like (*.powerbi.com or *.microsoft.com)
You might need to Use a WebSocket service hosted on allowed domain or Proxy through an allowed endpoint
AlsoThis approach uses a middle-tier service to handle the WebSocket connection which then pushes the data to Power BI:
Also here is Some Resources to help you solve this issue (I recommend it):
- Content security policy (Power Platform)
- How can i connect my websocket url to power bi to visualize live data (Check this)
if this post helps, then I would appreciate a thumbs up and mark it as the solution to help the other members find it more quickly.
Hi swamisharma,
The issue here is Power BI custom visuals run in a sandboxed environment with strict CSP rules and Your WebSocket connection to wss://echo.websocket.org/ is being blocked because:
- The CSP directive only allows connections to specific domains Like (*.powerbi.com or *.microsoft.com)
You might need to Use a WebSocket service hosted on allowed domain or Proxy through an allowed endpoint
AlsoThis approach uses a middle-tier service to handle the WebSocket connection which then pushes the data to Power BI:
Also here is Some Resources to help you solve this issue (I recommend it):
- Content security policy (Power Platform)
- How can i connect my websocket url to power bi to visualize live data (Check this)
Hello Ahmed-Elfeel , Thanks for the references and insights