Node Red connected to internal HA address

This is my first setup of Node red (via Docker) , i tried to add HA with internal address ( or https://localhost:8123 ) but it didn’t connect to HA , only with my duckdns domain the connection was o.k.
It can be very poor connection via the internet (with the domain address)
What can i do?