-
Notifications
You must be signed in to change notification settings - Fork 222
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
feat(createNodeHttpRequester): Add proxy support to another Agent on createNodeHttpRequester #1180
Conversation
This makes sense, however this would make that package a a dependency, alternatively you could make the whole agent an argument, so you can choose the version, as well as choosing a different agent. What do you think? |
Nice, i will do it ! |
Done. Now to use it, you have to : const agent = new HttpsProxyAgent(process.env.http_proxy); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not straightforward to test this, since the agent only gets called by http or https, so it's ok to leave this as-is for me
* feat(config): Add requester param to pass it to algoliasearch to use a corporate proxy We're using a corporate proxy and cannot make `gatsby-plugin-algolia` work without passing a custom requester. I found this PR (algolia/algoliasearch-client-javascript#1180) where `createNodeHttpRequester` was extended to pass a custom HTTP agent. With this change you can pass a custom requester to `gatsby-plugin-algolia` which resolved our issue. * feat(config): Add param to set the algoliasearch options * docs(readme): include algoliasearchOptions Co-authored-by: Haroen Viaene <hello@haroen.me>
Hey guys, today i needed call Algolia behind my entherprise proxy server.
I did not found no way to do this with this lib so I added to the createNodeHttpRequester this feature.
To use it, you need to pass the proxy url to requester option.
https://www.algolia.com/doc/api-client/advanced/configure-the-client/javascript/?language=javascript#requester
like this:
const algoliasearch = algoliasearch(
'YourApplicationID',
'YourSearchOnlyAPIKey',
{
requester: createNodeHttpRequester('http://yourproxy:8080')
},
);