Options
All
  • Public
  • Public/Protected
  • All
Menu

Class OptionsImpl

Implementation of the Options interface.

inheritdoc

Hierarchy

  • OptionsImpl

Implements

Index

Constructors

constructor

  • Create a new OptionsImpl instance

    The constructor takes a partially defined Options object and sets all undefined properties with their default values.

    Parameters

    • Default value options: Options = {}

      the options to create the instance from

    Returns OptionsImpl

Properties

activityMonitor

activityMonitor: boolean

A flag indicating whether to use the session activity monitor

credentials

credentials: string | Buffer

A password string to authenticate with, a buffer containing custom credentials in binary format, a typed array, or a regular array of octets.

host

host: string

The hostname to connect to (default 'localhost')

Optional httpProxyAgent

httpProxyAgent: any

An optional HTTP/HTTPS proxy agent. (default undefined)

If this is set, then the client will attempt to connect to the Diffusion server via a proxy server.

The proxy agent will be passed to the WebSocket constructor as the agent option. See https://www.npmjs.com/package/https-proxy-agent for an example of a proxy agent.

This option is used for web socket connections and is intended for Node based clients only. Browser based clients will automatically use the browser's proxy settings.

Example:

const HttpsProxyAgent = require('https-proxy-agent');
const url = require('url');
const diffusion = require('diffusion');

const agent = new HttpsProxyAgent(url.parse('https://proxy.example.com:80'));

diffusion.connect({
  host: 'https://diffusion.foo.com',
  httpProxyAgent: agent
}).then((session) => {
 // connected through proxy server
});

maxMessageSize

maxMessageSize: number

The maximum size of messages that may be received from the server. (default 2147483647)

path

path: string

The request path used for connections (default /diffusion)

port

port: number | string

The port to connect to (default 443)

principal

principal: string

The principal name this session should connect with. Used for authentication.

properties

properties: object

An object of key-value pairs that define the user-defined session properties.

For details of how session properties are used see Session.

Type declaration

  • [key: string]: string

reconnect

reconnect: object

Reconnection options. (default true)

Type declaration

secure

secure: boolean

Whether to use secure connections.

transports

transports: string[]

The transports to be used for connection establishment. (default "WEBSOCKET")

Methods

with

  • Create a new Options object containing the union of this with additional options.

    Parameters

    • options: Options

      options to merge

    Returns Options

    the new options