fixed port handling in url requests

This PR makes the script 'port aware' so that we can reach a device even if the web-server is set on a non-standard port (e.g. 8080)