syncthing/syncthing — pull request #684 by AudriusButkevicius (2014-09-13 19:36:54+00:00)
Title: Handle both protocols

"Inspired" by https://github.com/BenLubar/Rnoadm/maybetls
but avoids pulling the whole game as a dependency, and has the API slightly changed, as it makes no sense to have non-tcp TLS listeners.