New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sent requests via HTTP proxy #64
Comments
Fixed in 1.0.0. You can now specify additional options to the var google = require('googleapis');
var youtube = google.youtube({ version: 'v3', proxy: /* proxy here */ });
// .. use youtube object here To see more information look at README#Options and more information on setting a proxy can be found here. (Our library just relays the settings to the |
Seems it does not work for the auth API. I may be wrong but I think the proxy is not set in the calls to |
Hi @Juljan, there's a test you can find here that will show you how to apply things like proxy to a request. |
I have written an additional test here to test the scenario of setting a proxy with |
What about HTTPS proxys ? Is there any plan to support it in the future ? Should it be reported to the "request" project issues ? |
I have tried set a global proxy with google.options({ proxy: 'http://127.0.0.1:7777' }); But as I checked my local http proxy debug log, google api nodejs client does not always go through this proxy. Sometime it does, sometime it trys to access directly (and it would not success in my scenario). Can anyone help me test on it? |
As checking request doc, add this line before google.options({ proxy: 'http://127.0.0.1:7777' }); helps: process.env.HTTPS_PROXY = 'http://127.0.0.1:7777'; https://github.com/mikeal/request#controlling-proxy-behaviour-using-environment-variables |
Yep, process.env.HTTPS_PROXY = 'http://:'; worked for me. Thanks @aguegu |
I tried I found the below option works as expected: const HttpsProxyAgent = require('https-proxy-agent')
const {google} = require('googleapis')
google.options({
agent: new HttpsProxyAgent('http://127.0.0.1:8580')
}) This crashes on invalid proxies and works on valid proxies, as expected. Ref:
And gaxios introduces itself:
And node-fetch uses http-agent: |
It would be nice to be able to use the google-api-nodejs-client via a HTTP proxy. Request appears to support proxy configuration.
Possibly via the withOpts:
The text was updated successfully, but these errors were encountered: