PusherClientOptions
public struct PusherClientOptions
A collection of configuration options for a Pusher Channels HTTP API client.
-
The application identifier (as specified in the Channels developer dashboard).
Declaration
Swift
public let appId: Int -
The application key (as specified in the Channels developer dashboard).
Declaration
Swift
public let key: String -
The application secret (as specified in the Channels developer dashboard).
Declaration
Swift
public let secret: String -
The master key used for server-side encryption operations.
The master key is never shared with Pusher and should be kept secret. It should be a Base-64 encoded
Stringof 32 bytes of random data. An example command for generating such a key is:"openssl rand -base64 32".Declaration
Swift
public let encryptionMasterKey: String -
The Pusher cluster that hosts the Channels application (as specified in the Channels developer dashboard).
This will be
nilif a customhostis provided.Declaration
Swift
public let cluster: String? -
The host of the Channels application.
Declaration
Swift
public let host: String -
A HTTP proxy to use when routing traffic to a custom
host.The default value is
nil.Declaration
Swift
public let httpProxy: String? -
The port to use when routing traffic to the
host.Declaration
Swift
public let port: Int -
The scheme to use when routing traffic to the
host.Declaration
Swift
public let scheme: String -
Whether or not Transport Layer Security is used when sending and receiving traffic to and from the
host.The default value is
true.Declaration
Swift
public let useTLS: Bool
-
Creates a
PusherClientOptionsinstance using the default set of configuration options provided by the Pusher Channels developer dashboard.Throws
APusherErrorif the configuration options are invalid for some reason.Declaration
Swift
public init(appId: Int, key: String, secret: String, encryptionMasterKey: String, cluster: String, useTLS: Bool = true) throwsParameters
appIdThe application identifier (as specified in the Channels developer dashboard).
keyThe application key (as specified in the Channels developer dashboard).
secretThe application secret (as specified in the Channels developer dashboard).
encryptionMasterKeyThe master key used for server-side encryption operations. (Refer to
encryptionMasterKeyfor information on its expected format).clusterThe Pusher cluster that hosts the Channels application (as specified in the Channels developer dashboard).
useTLSWhether or not Transport Layer Security is used when sending and receiving traffic to and from the
host. The default value istrue. -
Creates a
PusherClientOptionsinstance from a collection of configuration options.Throws
APusherErrorif the configuration options are invalid for some reason.Declaration
Swift
public init(appId: Int, key: String, secret: String, encryptionMasterKey: String, cluster: String? = nil, host: String? = nil, httpProxy: String? = nil, port: Int? = nil, scheme: String? = nil, useTLS: Bool = true) throwsParameters
appIdThe application identifier (as specified in the Channels developer dashboard).
keyThe application key (as specified in the Channels developer dashboard).
secretThe application secret (as specified in the Channels developer dashboard).
encryptionMasterKeyThe master key used for server-side encryption operations. (Refer to
encryptionMasterKeyfor information on its expected format).clusterThe Pusher cluster that hosts the Channels application (as specified in the Channels developer dashboard). The default value is
nil.hostA custom host for a Channels application (e.g.
"myhost.com"). The default value isnil.httpProxyA HTTP proxy to use when routing traffic to a custom
host. The default value isnil.portA port to use when routing traffic to a custom
host. The default value isnil.schemeA scheme to use when routing traffic to a custom
host. The default value isnil.useTLSWhether or not Transport Layer Security is used when sending and receiving traffic to and from the
host. The default value istrue.
View on GitHub
PusherClientOptions Structure Reference