Create a new transport config initialized with the default settings.
ReadonlyconnectConfiguration for connecting to servers.
ReadonlyglobalSettings not associated with any specific type of transport.
ReadonlylistenConfiguration for listening for incoming connections.
ReadonlypeerConfiguration for peer-to-peer connections.
Returns true if the transport configuration is frozen, otherwise
returns false.
Returns a (deep) copy of the receiver.
(Deep) freezes the receiver such that it can't be modified anymore.
Enables or disables every peer-to-peer transport protocols defined in peerToPeer regardless of whether the current platform can actually drive those transport implementations.
Throws if receiver is frozen.
Use setAvailablePeerToPeerEnabled(). instead.
Enables or disables the peer-to-peer transport protocols defined in TransportConfigPeerToPeer that are supported on the current platform.
You can check the list of available transports for each platform at https://ditto.com/link/sdk-latest-compatibility
StaticareReturns true if passed in HTTP configurations are equal, otherwise
returns false.
StaticareReturns true if passed in TCP configurations are equal, otherwise
returns false.
A configuration object specifying which network transports Ditto should use to sync data.
A Ditto object comes with a default transport configuration where all available transports are enabled (for example, regarding peer-to-peer transports, Bluetooth LE and LAN on every platform, plus AWDL on Apple platforms or Wi‑Fi Aware on Android). You can customize this by copying that or initializing a new
TransportConfig, adjusting its properties, and supplying it tosetTransportConfig()onDitto.When you initialize a new
TransportConfiginstance, all transports are disabled. You must enable each one explicitly.Platform‑supported transports can also be toggled in a single call with setAvailablePeerToPeerEnabled().
Peer-to-peer transports will automatically discover peers in the vicinity and create connections without any configuration. These are configured via the
peerToPeerproperty. To turn each one on, set itsisEnabledproperty totrue.To connect to a peer at a known location, such as a Ditto Big Peer, add its address inside the connect configuration. These are either "host:port" strings for raw TCP sync, or a "wss://…" URL for websockets.
The listen configurations are for specific less common data sync scenarios. Please read the documentation on the Ditto website for examples. Incorrect use of listen can result in insecure configurations.
IMPORTANT: when running in the browser, only the
connect.websocketURLspart is considered, the rest of the configuration is ignored.