Configuring Transport Components

  • Undocumented

    See more

    Declaration

    Objective-C

    @interface DITAWDLConfig : NSObject<NSCopying, NSMutableCopying> {
        @protected BOOL _enabled;
    }
    
    @property (nonatomic, readonly, getter = isEnabled) BOOL enabled;
    
    - (instancetype)initWithDITAWDLConfig:(DITAWDLConfig *)config;
    - (instancetype)initWithEnabled:(BOOL)enabled NS_DESIGNATED_INITIALIZER;
    
    - (BOOL)isEqualToDITAWDLConfig:(DITAWDLConfig *)config;
    
    @end
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface DITMutableAWDLConfig : DITAWDLConfig
    
    @property (nonatomic, readwrite, getter = isEnabled) BOOL enabled;
    
    @end
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface DITBluetoothLEConfig : NSObject<NSCopying, NSMutableCopying> {
        @protected BOOL _enabled;
    }
    
    @property (nonatomic, readonly, getter = isEnabled) BOOL enabled;
    
    - (instancetype)initWithDITBluetoothLEConfig:(DITBluetoothLEConfig *)config;
    - (instancetype)initWithEnabled:(BOOL)enabled NS_DESIGNATED_INITIALIZER;
    
    - (BOOL)isEqualToDITBluetoothLEConfig:(DITBluetoothLEConfig *)config;
    
    @end
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface DITMutableBluetoothLEConfig : DITBluetoothLEConfig
    
    @property (nonatomic, readwrite, getter = isEnabled) BOOL enabled;
    
    @end
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface DITHTTPListenConfig : NSObject<NSCopying, NSMutableCopying> {
        @protected BOOL _enabled;
        @protected NSString *_interfaceIp;
        @protected uint16_t _port;
        @protected NSString *_staticContentPath;
        @protected BOOL _websocketSync;
        @protected NSString *_tlsKeyPath;
        @protected NSString *_tlsCertificatePath;
        @protected BOOL _isIdentityProvider;
        @protected NSString *_identityProviderSigningKey;
        @protected NSArray<NSString *> *_identityProviderVerifyingKeys;
        @protected NSString *_caKey;
    }
    
    @property (nonatomic, readonly, getter = isEnabled) BOOL enabled;
    /**
     IP interface to bind to. [::] by default.
     */
    @property (nonatomic, readonly) NSString *interfaceIp;
    /**
     Listening port. 80 by default.
     */
    @property (nonatomic, readonly) uint16_t port;
    /**
     An absolute path to a directory of static HTTP content that should be served by this device.
    
     If nil (default), this feature is disabled.
     */
    @property (nonatomic, readonly, nullable) NSString *staticContentPath;
    /**
     If YES (default), peers can connect over websocket to sync with this peer.
    
     This feature has security implications and should only be used together with documentation on Ditto's website.
     */
    @property (nonatomic, readonly) BOOL websocketSync;
    /**
     An absolute path to the PEM-formatted private key for HTTPS. Must be set together with tlsCertificatePath.
    
     If nil, the server runs as unencrypted HTTP.
     */
    @property (nonatomic, readonly, nullable) NSString *tlsKeyPath;
    /**
     An absolute path to the PEM-formatted certificate for HTTPS. Must be set together with tlsKeyPath.
    
     If nil, the server runs as unencrypted HTTP.
     */
    @property (nonatomic, readonly, nullable) NSString *tlsCertificatePath;
    /**
     Enable acting as a provider of Ditto identities.
     */
    @property (nonatomic, readonly) BOOL isIdentityProvider;
    /**
     PEM-encoded private key for signing tokens and certificates when acting as an identity provider.
     */
    @property (nonatomic, readonly, nullable) NSString *identityProviderSigningKey;
    /**
     PEM-encoded public keys for verifying tokens and certificates when acting as an identity provider.
     */
    @property (nonatomic, readonly, nullable) NSArray<NSString *> *identityProviderVerifyingKeys;
    /**
     PEM-encoded private key that should be used to issue certificates for clients in peer-to-peer mode.
     */
    @property (nonatomic, readonly, nullable) NSString *caKey;
    
    
    - (instancetype)initWithDITHTTPListenConfig:(DITHTTPListenConfig *)config;
    - (instancetype)initWithEnabled:(BOOL)enabled
                        interfaceIp:(NSString *)interfaceIp
                               port:(uint16_t)port
                  staticContentPath:(NSString * __nullable)staticContentPath
                      websocketSync:(BOOL)websocketSync
                         tlsKeyPath:(NSString * __nullable)tlsKeyPath
                 tlsCertificatePath:(NSString * __nullable)tlsCertificatePath
                 isIdentityProvider:(BOOL)isIdentityProvider
         identityProviderSigningKey:(NSString * __nullable)identityProviderSigningKey
      identityProviderVerifyingKeys:(NSArray<NSString *> * __nullable)identityProviderVerifyingKeys
                              caKey:(NSString * __nullable)caKey NS_DESIGNATED_INITIALIZER;
    
    - (BOOL)isEqualToDITHTTPListenConfig:(DITHTTPListenConfig *)config;
    
    @end
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface DITMutableHTTPListenConfig : DITHTTPListenConfig
    
    @property (nonatomic, readwrite, getter = isEnabled) BOOL enabled;
    /**
     IP interface to bind to. [::] by default.
     */
    @property (nonatomic, readwrite, copy) NSString *interfaceIp;
    /**
     Listening port. 80 by default.
     */
    @property (nonatomic, readwrite) uint16_t port;
    /**
     An absolute path to a directory of static HTTP content that should be served by this device.
    
     If nil (default), this feature is disabled.
     */
    @property (nonatomic, readwrite, copy, nullable) NSString *staticContentPath;
    /**
     If YES (default), peers can connect over websocket to sync with this peer.
    
     This feature has security implications and should only be used together with documentation on Ditto's website.
     */
    @property (nonatomic, readwrite) BOOL websocketSync;
    /**
     An absolute path to the PEM-formatted private key for HTTPS. Must be set together with tlsCertificatePath.
    
     If nil (default), the server runs as unencrypted HTTP.
     */
    @property (nonatomic, readwrite, copy, nullable) NSString *tlsKeyPath;
    /**
     An absolute path to the PEM-formatted certificate for HTTPS. Must be set together with tlsKeyPath.
    
     If nil (default), the server runs as unencrypted HTTP.
     */
    @property (nonatomic, readwrite, copy, nullable) NSString *tlsCertificatePath;
    /**
     Enable acting as a provider of Ditto identities.
     */
    @property (nonatomic, readwrite) BOOL isIdentityProvider;
    /**
     PEM-encoded private key for signing tokens and certificates when acting as an identity provider.
     */
    @property (nonatomic, readwrite, copy, nullable) NSString *identityProviderSigningKey;
    /**
     PEM-encoded public keys for verifying tokens and certificates when acting as an identity provider.
     */
    @property (nonatomic, readwrite, copy, nullable) NSArray<NSString *> *identityProviderVerifyingKeys;
    /**
     PEM-encoded private key that should be used to issue certificates for clients in peer-to-peer mode.
     */
    @property (nonatomic, readwrite, copy, nullable) NSString *caKey;
    
    @end
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface DITLANConfig : NSObject<NSCopying, NSMutableCopying> {
        @protected BOOL _enabled;
        @protected BOOL _mDNSEnabled;
        @protected BOOL _multicastEnabled;
    }
    
    @property (nonatomic, readonly, getter = isEnabled) BOOL enabled;
    @property (nonatomic, readonly, getter = ismDNSEnabled) BOOL mDNSEnabled;
    @property (nonatomic, readonly, getter = isMulticastEnabled) BOOL multicastEnabled;
    
    - (instancetype)initWithDITLANConfig:(DITLANConfig *)config;
    - (instancetype)initWithEnabled:(BOOL)enabled
        mDNSEnabled:(BOOL)mDNSEnabled
        multicastEnabled:(BOOL)multicastEnabled NS_DESIGNATED_INITIALIZER;
    
    - (BOOL)isEqualToDITLANConfig:(DITLANConfig *)config;
    
    @end
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface DITMutableLANConfig : DITLANConfig
    
    @property (nonatomic, readwrite, getter = isEnabled) BOOL enabled;
    @property (nonatomic, readwrite, getter = ismDNSEnabled) BOOL mDNSEnabled;
    @property (nonatomic, readwrite, getter = isMulticastEnabled) BOOL multicastEnabled;
    
    @end
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface DITTCPListenConfig : NSObject<NSCopying, NSMutableCopying> {
        @protected BOOL _enabled;
        @protected NSString *_interfaceIp;
        @protected uint16_t _port;
    }
    
    @property (nonatomic, readonly, getter = isEnabled) BOOL enabled;
    /**
     IP interface to bind to. [::] by default.
     */
    @property (nonatomic, readonly) NSString *interfaceIp;
    /**
     Listening port. 4040 by default.
     */
    @property (nonatomic, readonly) uint16_t port;
    
    - (instancetype)initWithDITTCPListenConfig:(DITTCPListenConfig *)config;
    - (instancetype)initWithEnabled:(BOOL)enabled
                        interfaceIp:(NSString *)interfaceIp
                               port:(uint16_t)port NS_DESIGNATED_INITIALIZER;
    
    - (BOOL)isEqualToDITTCPListenConfig:(DITTCPListenConfig *)config;
    
    @end
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface DITMutableTCPListenConfig : DITTCPListenConfig
    
    @property (nonatomic, readwrite, getter = isEnabled) BOOL enabled;
    /**
     IP interface to bind to. [::] by default.
     */
    @property (nonatomic, readwrite, copy) NSString *interfaceIp;
    /**
     Listening port. 4040 by default.
     */
    @property (nonatomic, readwrite) uint16_t port;
    
    @end
  • Specific servers that Ditto should attempt to connect to.

    TCP servers are specified as “host:port”. Websocket URLs take the form “wss://hydra.ditto.live”.

    Please refer to the documentation on Ditto’s website for configuring cloud or client/server scenarios.

    See more

    Declaration

    Objective-C

    @interface DITConnect : NSObject <NSCopying, NSMutableCopying> {
      NSSet<NSString *> *_tcpServers;
      NSSet<NSString *> *_websocketURLs;
    }
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface DITMutableConnect : DITConnect
  • Configuration of peer-to-peer transports, which are able to discover and connect to peers on their own.

    For more information refer to the documentation for DITTransportConfig.

    See more

    Declaration

    Objective-C

    @interface DITPeerToPeer : NSObject <NSCopying, NSMutableCopying> {
      DITBluetoothLEConfig *_bluetoothLe;
      DITLANConfig *_lan;
      DITAWDLConfig *_awdl;
    }
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface DITMutablePeerToPeer : DITPeerToPeer
  • Configure this device as a Ditto server. Disabled by default.

    This is advanced usage that is not needed in most situations. Please refer to the documentation on Ditto’s website for scenarios and example configurations.

    See more

    Declaration

    Objective-C

    @interface DITListen : NSObject <NSCopying, NSMutableCopying> {
      DITTCPListenConfig *_tcp;
      DITHTTPListenConfig *_http;
    }
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface DITMutableListen : DITListen