code: public static function parseUrl($url): Endpoint
      {
          $url = UrlParser::parseUrl($url);
          
          return new Endpoint($url->getAddress(), $url->getPort());
      }
docs: Parse a URI into a Endpoint
  
  @param string $url
  @throws InvalidUrlException
  @return \Generics\Socket\Endpoint