Skip to content
Pablo Ojanguren edited this page Mar 20, 2017 · 1 revision

Configuring low-level network parameters

In some situations a fine-grained configuration of network transports are required. Some configuration properties are provided in both server and JavaScript client. Please be careful. Changing some of these values can turn the system unustable.

server.config

Following server's session and websocket parameters can be set in the server.config master configuration file:


# Max age of session cookie in seconds.
# -1 means cookie lives in the browser current session only.
# Default value: -1
session_cookie_max_age = -1

Max intactive time before deletion of server's session, in seconds (48h)
session_server_max_inactive_time = 172800

# The time in ms that the websocket connection can be idle before closing
# Default value: 0
websocket_max_idle_time = 0

# Maximum websocket message size to be received in MB
# Default value: 2
websocket_max_message_size = 2

# Time interval between hearbeat marks sent to clients, in seconds
websocket_heartbeat = 25

JavaScript client

For tunning the Atmosphere JavaScript client, applications can define the following object before doing any operation against 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,

};