mirror of
https://github.com/HackPlan/node-iap.git
synced 2026-06-14 08:59:15 +08:00
Add proxy support
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
var url = require('url');
|
||||
var https = require('https');
|
||||
|
||||
var config = require('../config')
|
||||
|
||||
module.exports = function (requestUrl, options, data, cb) {
|
||||
options = options || {};
|
||||
@@ -19,6 +19,11 @@ module.exports = function (requestUrl, options, data, cb) {
|
||||
options.path = parsedUrl.path;
|
||||
}
|
||||
|
||||
if (options.platform) {
|
||||
options.agent = config.getAgent(options.platform);
|
||||
delete options.platform;
|
||||
}
|
||||
|
||||
var req = https.request(options, function (res) {
|
||||
res.setEncoding('utf8');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user