Yeah, you can write your own system where a python app on the X4 connects to a server of your own creation, and then your client applications talk to that server.
Or… if your X4 is directly accessible on the internet, then you can communicate to it directly from there. However, why not just use the cloud? It’s so much easier.