make HTTP server listen on network of the domain

The HTTP server was systematically listening on the first host IP address found
in YAML file, even if the domain in parameter of wait_event() was not connected
to this network. This was a bit messy. Now, the HTTP server listens on the first
found host IP address of the networks connected to the particular domain.