How does switching from relay to direct connection work?

I stumbled today upon a situation described in the following and I wonder how the switching to a direct connection works in detail in syncthing.

The setup is as follows:

  • Device A: only accessible over relay
  • Device B: accessible over relay and direct connection

I know that syncthing will try to establish a direct connections when it is connected to another device over relay. So, this is what I observed in the past:

Device A connects to Device B via relay (doesn’t matter why), will retry a direct connection from time to time and will eventually use a direct connection.

The question is, does it also work the other way round?

Device B connects to Device A. This has to be by relay. Device B will not be able to establish a direct connection, but Device A could. Will Device A also try to switch to a direct connection or is this only done by the initiator of a connection?

Both devices know that they are connected via a relay, and both devices will continuously attempt to get a direct connection to the other. When any of them succeed, they switch to using the direct connection instead.

1 Like

Thanks a lot. :thumbsup: