From 2fc07ee80194944e00ee01aec4cf497ba4fb082e Mon Sep 17 00:00:00 2001 From: Justin SB Date: Tue, 9 Sep 2014 13:02:32 -0700 Subject: [PATCH] Pass http_proxy to the emulator if the httpProxyPort is set It doesn't work for Cordova, though it does work for the browser This may get fixed later --- tools/commands-cordova.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/commands-cordova.js b/tools/commands-cordova.js index ca55778d33..03ccee4d49 100644 --- a/tools/commands-cordova.js +++ b/tools/commands-cordova.js @@ -684,11 +684,11 @@ var execCordovaOnPlatform = function (localPath, platformName, options) { } else { verboseLog('Running emulator:', localCordova, args); var emulatorOptions = { verbose: options.verbose, cwd: cordovaPath }; - emulatorOptions.env = {}; + emulatorOptions.env = _.extend({}, process.env); if (options.httpProxyPort) { // XXX: Is this Android only? - // XXX: Is 10.0.2.2 always the IP? - emulatorOptions.env['http_proxy'] = '10.0.2.2:' + options.httpProxyPort; + // This is odd; the IP address is on the host, not inside the emulator + emulatorOptions.env['http_proxy'] = '127.0.0.1:' + options.httpProxyPort; } execFileAsyncOrThrow( localCordova, args,