websockets.integration
Classes
Add application-bound websocket broadcast communication. |
Functions
|
|
|
|
|
Module Contents
- class websockets.integration.WebsocketsApp[source]
Bases:
more.webassets.WebassetsApp
Add application-bound websocket broadcast communication.
To receive broadcast messages using JavaScript in the browser, include the asset ‘websockets’ and call
openWebsocket
.To send broadcast messages, call
send_websocket
with a JSON-serializable message.- configure_websockets(*, websockets: dict[str, Any] | None = None, **cfg: Any) None [source]
Configures global websocket settings.
- websockets_client_url(request: onegov.core.request.CoreRequest) str [source]
Returns the public websocket endpoint that can be used with JS.
Upgrades the scheme to wss if request URL is https and fills in netloc based on the request URL if missing.
- websockets.integration.websocket_csp_tween_factory(app: WebsocketsApp, handler: Callable[[CoreRequest], Response]) Callable[[CoreRequest], Response] [source]