Sent requests via HTTP proxy
See original GitHub issueIt 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:
discover('youtube', 'v3').withOpts({ proxy: 'http://mylocalproxy.com' });
Issue Analytics
- State:
- Created 10 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
6.5. Tricky Things About Proxy Requests - HTTP - O'Reilly
Tricky Things About Proxy Requests This section explains some of the tricky and much misunderstood aspects of proxy server requests, including: How the...
Read more >How to Use a Proxy with Python Requests? - ScrapingBee
To use a proxy in Python, first import the requests package. Next create a proxies dictionary that defines the HTTP and HTTPS connections....
Read more >how does http proxy work? - Stack Overflow
The SERVER will only see the PROXY as connection and answer to the PROXY just like to a CLIENT. The PROXY receives the...
Read more >Proxy servers and tunneling - HTTP - MDN Web Docs
Proxies can make requests appear as if they originated from the proxy's IP address. This can be useful if a proxy is used...
Read more >Sending HTTP Requests through Proxy Server using Python
This video explains how to send HTTP requests through proxy server using requests library in Python.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
I tried
google.options({ proxy: 'http://SOMETHING_WRONG' })
. It works regularly! So it shouldn’t be the correct setting.I found the below option works as expected:
This crashes on invalid proxies and works on valid proxies, as expected.
Ref: https://github.com/googleapis/google-api-nodejs-client#request-options says:
And gaxios introduces itself:
And node-fetch uses http-agent:
https://github.com/node-fetch/node-fetch#custom-agent