diff --git a/package.json b/package.json index f4ebf39..8f532dd 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { - "name": "magento", + "name": "magento-secure", "author": "Tim Marshall ", "description": "Magento SOAP API wrapper for Node.js", - "version": "0.0.5", + "version": "0.0.6", "main": "./src/magento", "contributors": [ { @@ -13,7 +13,7 @@ "engines": { "node": ">=0.10.20" }, - "dependencies" : { + "dependencies": { "request": "2.34.0", "xmlrpc": "1.2.0" }, @@ -23,6 +23,6 @@ "api", "xml" ], - "repository": "git://github.com/MadisonReed/magentoapi", + "repository": "https://github.com/aaabhilash97/magentoapi.git", "license": "MIT" } diff --git a/src/magento.js b/src/magento.js index 1d3938b..8e736a1 100644 --- a/src/magento.js +++ b/src/magento.js @@ -48,7 +48,9 @@ var configDefaults = { path: mandatory, login: mandatory, pass: mandatory, - parallelLimit: Infinity + parallelLimit: Infinity, + is_secure: false, + secure: false }; /** @@ -77,7 +79,11 @@ function Magento(config) { } this.config = magentoConfig; - this.client = xmlrpc.createClient(this.config); + if (this.config.is_secure || this.config.secure || this.config.port == 443) { + this.client = xmlrpc.createSecureClient(this.config); + } else { + this.client = xmlrpc.createClient(this.config); + } this.queue = []; this.queue.running = 0; this.queue.parallelLimit = this.config.parallelLimit;