Node.js googleapi中的代理问题

Node.js googleapi中的代理问题,node.js,proxy,google-api,google-calendar-api,Node.js,Proxy,Google Api,Google Calendar Api,现在我正在用node.js程序开发一个Google日历应用程序。现在我面临代理问题 首先,我尝试了谷歌的测试样本,如果我的node.js程序直接访问互联网(我的意思是没有代理),它就可以工作。但当我试图在代理环境中运行相同的程序时,它失败了。除了代理设置外,我在链接下面使用相同的代码 尝试获取令牌时失败。实际上,这个代理是有效的,因为我在同一台电脑上使用相同的代理设置 Error while trying to retrieve access token { [Error: tunneling

现在我正在用node.js程序开发一个Google日历应用程序。现在我面临代理问题

首先,我尝试了谷歌的测试样本,如果我的node.js程序直接访问互联网(我的意思是没有代理),它就可以工作。但当我试图在代理环境中运行相同的程序时,它失败了。除了代理设置外,我在链接下面使用相同的代码

尝试获取令牌时失败。实际上,这个代理是有效的,因为我在同一台电脑上使用相同的代理设置

Error while trying to retrieve access token { [Error: tunneling socket could not be established, cause=139916950681408:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:787:
] code: 'ECONNRESET' }
为了进行调试,我在TunnelingAgent()的打印选项中添加了代码:google auth library/node_modules/request/node_modules/tunnel agent/index.js。我证实了 代理设置打印如下

options: { proxy:
   { host: 'xxx',
     port: 12345,
     proxyAuth: null,
     headers:
      { 'User-Agent': 'google-api-nodejs-client/0.9.7',
        host: 'accounts.google.com:443' } },
  headers: { 'User-Agent': 'google-api-nodejs-client/0.9.7' },
  ca: undefined,
  cert: undefined,
  key: undefined,
  passphrase: undefined,
  pfx: undefined,
  ciphers: undefined,
  rejectUnauthorized: undefined,
  secureOptions: undefined,
  secureProtocol: undefined }
会发生什么

我的裁判:


我发现代理设置不影响getToken。我将此问题作为一个问题报告。我的临时解决方案是直接将代理属性添加到请求选项中。我怀疑google.options.proxy无法获取令牌。获取令牌后,google.options.proxy看起来工作正常。
options: { proxy:
   { host: 'xxx',
     port: 12345,
     proxyAuth: null,
     headers:
      { 'User-Agent': 'google-api-nodejs-client/0.9.7',
        host: 'accounts.google.com:443' } },
  headers: { 'User-Agent': 'google-api-nodejs-client/0.9.7' },
  ca: undefined,
  cert: undefined,
  key: undefined,
  passphrase: undefined,
  pfx: undefined,
  ciphers: undefined,
  rejectUnauthorized: undefined,
  secureOptions: undefined,
  secureProtocol: undefined }