Fixed the port setting depending localhost or actual server.