View examples for:


On this page:

# Connect to Diffusion

Before you can start interacting with Diffusion from your application, you must connect your client. This establishes a WebSocket (or long-polling HTTP) connection from your client application to Diffusion, over which all subsequent interactions are sent.

# Import client

# Credentials

To connect to Diffusion, you will need the hostname that you are connecting to, as well as a principal (username) and password to authenticate your connection. If you haven't setup any credentials yet, you can create a new credentials pair in the Security tab of your service in the Dashboard.

For self-hosted installations, the default credentials are admin/passsword.

See the Authentication section for more details about client authentication.

# Connecting

When you connect to Diffusion the SDK will provide a session object. If a connection is lost (due to bad network conditions or application failure), clients can reconnect to the same session without losing any data. Sessions also have metadata associated with them, which can be used for operations that target specific sessions or groups of sessions.