Yes, the established standard here is known collectively as Interactive Connectivity Establishment (ICE) [1] which WebRTC relies on -- there are a few good libraries out there that implement it and/or various elements of it [2] [3].
libp2p [4] may be what you're after if you want something geared more towards general purpose connectivity.
FWIW, libp2p also enforces transport encryption, quote:
Encryption is an important part of communicating on the libp2p network. Every connection must be encrypted to help ensure security for everyone. As such, Connection Encryption (Crypto) is a required component of libp2p.
Comments
Yes, the established standard here is known collectively as Interactive Connectivity Establishment (ICE) [1] which WebRTC relies on -- there are a few good libraries out there that implement it and/or various elements of it [2] [3].
libp2p [4] may be what you're after if you want something geared more towards general purpose connectivity.
[1] https://datatracker.ietf.org/doc/html/rfc8445
[2] https://github.com/pion/webrtc
[3] https://github.com/algesten/str0m
[4] https://libp2p.io
Thank you for the resources! I will study them.
FWIW, libp2p also enforces transport encryption, quote: