Added code to generate URL with port.