Adds the appropriate protocol (http or https) to the given URL based on whether the URL contains the string 'localhost'.

  • Parameters

    • Optionalurl: string

      The URL to modify.

    Returns string

    A new URL string with the appropriate protocol added.