Add an optional port parameter, which can be either a number or a string (to support '+' and '-' for port mapping). This fixes issue #586.