igcv3 - v1.1.0
    Preparing search index...

    Function parseTarget

    • Parse a target string into hostname and optional port. Supports multiple formats: bare hostname, host:port, URL, IPv6 with brackets.

      Parameters

      Returns ParsedTarget

      Parsed target with hostname and optional port

      If input is empty or invalid

      If URL protocol is not http/https

      If port number is invalid (not 1-65535)

      If IPv6 format is malformed

      parseTarget('google.com')           // { hostname: 'google.com' }
      parseTarget('google.com:443') // { hostname: 'google.com', port: 443 }
      parseTarget('https://google.com') // { hostname: 'google.com' }
      parseTarget('[::1]:8080') // { hostname: '[::1]', port: 8080 }