GitHub user dosubot[bot] added a comment to the discussion: websocket
connection to superset
<!-- Answer -->
The CSP error is blocking your websocket connection because Superset's default
Content Security Policy only allows connections to 'self', api.mapbox.com, and
events.mapbox.com. To fix this, add your websocket server address (e.g.,
ws://10.3.10.171:30089) to the 'connect-src' directive in TALISMAN_CONFIG
inside your superset_config.py, like this:
```python
TALISMAN_ENABLED = True
TALISMAN_CONFIG = {
"content_security_policy": {
"connect-src": [
"'self'",
"https://api.mapbox.com",
"https://events.mapbox.com",
"ws://10.3.10.171:30089", # Add your websocket URL here
],
# ... other directives ...
},
# ... other config ...
}
```
After updating, restart Superset so the new CSP headers are applied. Then
reload your browser and check the console and websocket pod logs—if configured
correctly, you should see active websocket connections and the manual refresh
issue should be resolved.
The other console errors (deprecation warning, configure(...) warning,
TypeError in ContentScript.js) are unrelated to the websocket/CSP problem and
can be ignored for now. Focus on resolving the CSP violation first.
Reference: [Superset CSP
config](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/config.py)
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
---
<sup>How did I do?
[Good](https://app.dosu.dev/response-feedback/661f9c3a-8ca2-4c94-945f-ed12fbcf2271?feedback_type=great_response)
|
[Irrelevant](https://app.dosu.dev/response-feedback/661f9c3a-8ca2-4c94-945f-ed12fbcf2271?feedback_type=irrelevant_answer)
|
[Incorrect](https://app.dosu.dev/response-feedback/661f9c3a-8ca2-4c94-945f-ed12fbcf2271?feedback_type=incorrect_sources)
|
[Verbose](https://app.dosu.dev/response-feedback/661f9c3a-8ca2-4c94-945f-ed12fbcf2271?feedback_type=too_verbose)
|
[Hallucination](https://app.dosu.dev/response-feedback/661f9c3a-8ca2-4c94-945f-ed12fbcf2271?feedback_type=hallucination)
| [Report
🐛](https://app.dosu.dev/response-feedback/661f9c3a-8ca2-4c94-945f-ed12fbcf2271?feedback_type=bug_report)
|
[Other](https://app.dosu.dev/response-feedback/661f9c3a-8ca2-4c94-945f-ed12fbcf2271?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&
nbsp;[](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/34703)
GitHub link:
https://github.com/apache/superset/discussions/34703#discussioncomment-14107093
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]