code: function findTargetPort(hostname, port) {
    if (!hostname)
      return null;
  
    const route = routing.get(hostname);
    if (route)
      return route[port];
  
    // This will first expand www.hostname.com to *.www.hostname.com,
    // then contract it to *.hostname.com, *.com and finally *.
    const wildcard = hostname.replace(/^(\*\.[^.]+(\.|$))?/, '*.');
    if (wildcard !== '*.')
      return findTargetPort(wildcard, port);
  }
docs: If there's a route for host/port, returns destination port number.  Called recursively to handle wildcards.  Starting with the host www.example.com, it will attempt to match routes from most to least specific:  www.example.com *.www.example.com *.example.com *.com