Connect to Unity from external program

Hi,
I try to connect to unity from an external program via UDP. I found a great NetworkTransport example in the docs and it works fine if I communicate between two Unity instances. But as soon as I try to connect from another non-Unity program, I get either a warning: “Warning: wrong connectionId in received user packet” or nothing at all if I try it from python like this:

UDP_IP = '127.0.0.1'
UDP_PORT = 1531
MESSAGE = "Hello, World!"

sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.sendto(MESSAGE, (UDP_IP, UDP_PORT))

What works fine if I have a server and client implemented in python, but I simply do not get any response in Unity. So I suppose my understanding of the way the NetworkTransport works is wrong.
Is it designed to work with any UDP communication, or does it only work inside a Unity Network?

Just in case anyone is interested: I was unable to make it work with builtin NetworkTransport classes. So I implemented the System.Net.Sockets with UdpClient and now it works like a charm.

We’re using TcpClient in Unity to connect to our p2p servers written in Go. This means that Unity is only burdened with a vanilla tcp connection while our Go nodes do all the heavy lifting (wrt to p2p data sharing and replicating). This also means we get full platform support since our Unity client app can run on Windows, macOS, linux, and iOS & Android. Our iOS and Android client, just like the desktop clients, connect to our server via tcp (TcpClient), but for the mobile platforms, the server they’re connected to is remote.