Services defining the HOST and PORT where they are going to run is quite counter intuitive.
If there is an entity who knows where each service is going to run, whats the point of having a registry?
Registry should detect the IP address from where it gets the registration packet.
The HOST address may either be statically specified / detected by socket.gethostbyname(socket.gethostname()) and in both the cases the ip reported may be something behind a NAT and inaccessible for other services / registry itself.
And the services can easily listen to all the interfaces by specifying '0.0.0.0' as their host address.
EDIT: After discussion with @nerandell
Primary concern is that the service needs to know its own "external" ip address which
registry can easily find out, based on the connection it gets.
someone (the devops) needs to hardcode into service's config.json file
registration
packet.socket.gethostbyname(socket.gethostname())
and in both the cases the ip reported may be something behind a NAT and inaccessible for other services / registry itself.EDIT: After discussion with @nerandell Primary concern is that the service needs to know its own "external" ip address which
@nerandell @kashifrazzaqui views?