Configuring Transports
This article provides instructions on how to explicitly configure your Ditto instance to listen for connections on a specific port and to connect to remote instances using a host (IP) and port.
Although Ditto automatically attempts to connect to other instances on the Local Area Network (LAN), Bluetooth Low Energy (LE), and Apple Wireless Direct Link (AWDL), supplying a DittoTransportConfig does not enable this feature by default.
You must manually enable peer-to-peer connections using EnableAllPeerToPeer(). For instructions, see Enabling and Disabling Transports.
In some cases, you may need to set up additional connection configurations for the current Ditto instance. This section provides instructions on how to explicitly configure your Ditto instance to listen for connections on a specific port and to connect to remote instances using a host (IP) and port.
To configure additional connection settings for the current Ditto instance, before calling startSync(), construct a DittoTransportConfig value and set it using ditto.SetTransportConfig.
If syncing over LAN, ensure WebSocket connections are discoverable across peers within your local network: