-
Notifications
You must be signed in to change notification settings - Fork 34
Advanced Topics
When the SwellRT JavaScript API client and your App are not in the same domain/subdomain you could run into issues with some browser forcing the Same Origin Policy.
By default, SwellRT's JavaScript client will communicate with the server using the WebSocket protocol if it is available. If not, the fallback protocol will be long-polling. If you want to force disabling WebSockets, call the following method just before start a new session:
SwellRT.useWebSocket(false);
In some situations cached versions of the JavaScript client library became obsolete. In order to avoid further issues and allowing apps to reload the JS client properly, a global FATAL_EXCEPTION will be raised with the value data.cause = CLIENT_UPGRADE
if the SwellRT server can't work with current client's version.
For tunning the underlying Atmosphere JavaScript client, applications can define the following object before doing operation with the SwellRT API:
window.__atmosphere_config = {
logLevel: "info", // info, debug
transport: "websocket",
fallbackTransport: "long-polling",
pollingInterval: 5000,
trackMessageLength: true,
enableXDR: true,
readResponsesHeaders: false,
withCredentials: true,
dropHeaders: true,
timeout: 27000,
connectTimeout: -1,
reconnectInterval: 5000,
maxReconnectOnClose: 5,
reconnectOnServerError: true,
};
Texts and images of the SwellRT Wiki are released as open content, under the Creative Commons Attribution 4.0 International.