Integrate relay functionality into Syncthing client.

Original discussion is in issue 4182.

The general idea is pretty simple, allow a regular Syncthing node to act as a relay between two (or more) other nodes it trusts, thus removing the need in certain configurations for an external relay, and probably increasing sync bandwidth between the trusted nodes.

Example use case: 3 nodes, A, B, and C. Node B has an internet routable address and A and C are configured to connect directly to it.

With the current system, A and C both need to contact a global discovery server and then use relay to communicate.

With this change, B could operate as a relay for A and C, removing the need for an external relay, and possibly (depends on how it’s implemented) removing the need for the global discovery server.

2 Likes