Golang cannot send packets to stun received ip

198 Views Asked by At

I’m using Golang to try to send packets through UDP to an IP address and port provided by STUN. The goal is to communicate between two devices without having to open a port in the firewall, as both devices are located in a different network.

The program runs on both devices in the following manner: Device 1 waits for device 2 to send the IP address and port found by STUN. This goes through an open port in the firewall of device 1. (Only for device 1 an open port is possible) The problem is that device 2 does not receive any packets through the port found by STUN.

I think the problem consists of the router not knowing the connection to device 2. Device 2 is connected with the router, but the router doesn’t know what to do with the packets.

Do you have any idea how to solve this problem?

Thanks!

0

There are 0 best solutions below