Added auto detection of URL & port.