docs: function Endpoint(url) {
    if (!(this instanceof Endpoint)) return new Endpoint(url);
  
    var p;
    if (typeof url === 'string') {
      //parse url
      var rr = REGEXP_URL.exec(url);
      if (rr) {
        p = {
          protocol: rr[1],
          username: rr[2],
          password: rr[3],
          host: rr[4],
          port: rr[5],
          path: rr[6],
          url: rr[0]
        };
      }
    } else if (typeof url === 'object') {
      p = url;
    }
    p || (p = {});
  
    this.protocol = (p.protocol && p.protocol.toLowerCase()) || PROTOCOL.TCP;
    p.username && (this.username = p.username);
    p.password && (this.password = p.password);
    this.host = p.host || 'localhost';
    this.port = p.port || defaultPort(this.protocol);
    p.path && (this.path = p.path);
    p.url && (this.url = p.url);
  }