title: WebSocket connection to a server behind NAT
body: <p>I am building a system in which multiple devices are talking to each other using WebSocket connection. The data needs to be transferred in real-time and it can vary in volumes from several bytes to streams of images. Therefore, data providers run WebSocket servers and data consumers request data from them. Everything is working fine on the same network if I use IP addresses to connect to WebSocket servers. But what to do, if I have WebSocket server behind a NAT and I cannot configure port forwarding? I have a separate external machine, with known IP address, which can be accessed from anywhere and I've started digging into STUN/TURN protocols, but did not come to any result so far and I would be glad if there is already a ready to use solution.</p>