constructor(endpoint, ssl) { const UA = pjson.name + ' v' + pjson.version const uri = endpoint || (ssl ? url_ssl : url) const req = URIjs(uri)._parts const secure = req.protocol === 'https' const opts = { host: req.hostname, port: req.port || (secure ? 443 : 80), path: req.path, headers: { 'User-Agent': UA } } this.client = secure ? xmlrpc.createSecureClient(opts) : xmlrpc.createClient(opts) }