I made a simple chat room using javascript, html and peerjs library.
When two clients connect to a common Wi-Fi everything works fine.
But when a client connects to the global Internet and shares its connection with another client through a hotspot:
Everything goes well until peers (clients) try to connect to each other. A little effort is made, but in the end it fails.
But with the construct that I tried, communication was established well in both cases.
I ask the construct designer to guide me, what function or method should I use to solve this problem