Parameterize ports for ha

In order to make the code a little more
flexible.