ConfigData

Stores the client configuration settings.

Constructor

new ConfigData()

Creates a new instance of the ConfigData class.
Pass the instance to the SmartFox#connect method when connecting the client to SmartFoxServer.

Classes

AudioCfg

Members

_netDebugLevel :number

Type:
  • number

audio :ConfigData.AudioCfg

Configuration settings for audio stream capture and playback.

host :string

IP address or host name of the SmartFoxServer instance to connect to.
Type:
  • string
Default Value
  • 127.0.0.1

netDebugLevel :number

The level of client-server debug messages that should be logged by the client, among those provided by the NetDebugLevel class.
Type:
  • number
Default Value

port :number

WebSocket port of the SmartFoxServer instance to connect to.
Type:
  • number
Default Value
  • 8088

useSSL :boolean

Instructs the API to use the WebSocket Secure (WSS) protocol instead of the default WebSocket (WS) protocol to protect all client-server communication.

If set to true, ConfigData#port value must be set to SmartFoxServer's WSS port too.

Type:
  • boolean
Default Value
  • false

zone :string

Zone of the SmartFoxServer instance to join during the login process.
Type:
  • string
Default Value
  • null

Methods

(async) load(url) → {Promise.<void>}

Loads and parses an external configuration file from a URL and overrides the default values of the ConfigData properties.

The configuration file must contain a "name=value" pair per line. Use dot notation for nested properties (i.e. audio.enableAEC=true). Lines starting with # are skipped.

Parameters:
NameTypeDescription
urlstringThe URL of the configuration file, relative to the importing script's root or absolute.
Returns:
A promise resolving when the configuration has been loaded and applied.
Type: 
Promise.<void>