Setting to connect component to localhost?

Hello,

I am trying to set this up and it seems to run and connect fine as a component to my Prosody server, however it only starts correctly when I use the fully qualified domain name in the service: xmpp://example.com:5347 setting. 127.0.0.1:5347 or localhost:5347 is not working, despite the service running on the same server (no docker etc).

But when I look at the logs it is clear that the component is then connecting via the public IP and it seems like the connection is quite unstable with a reconnection happening every 30 minutes or so.

Any idea how to make it connect directly to the Prosody on localhost?

Thanks!