take the host and port automatically