-
Notifications
You must be signed in to change notification settings - Fork 50
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
Best Practise Proxy Support 😀👏🏼 #54
Comments
What I would suggest you do is to use https://github.com/octokit/core.js where you can pass const { Octokit } = require('@octokit/core')
const { createAppAuth } = require("@octokit/auth-app");
const httpsAgent = new https.Agent({ keepAlive: true });
const MyEnterpriseOctokit = Octokit.defaults({
authStrategy: createAppAuth,
baseUrl: YOUR_ENTERPRISE_BASE_URL,
request: { agent: httpsAgent }
})
const octokit = new Octokit({
auth: {
id: 1,
privateKey: "-----BEGIN PRIVATE KEY-----\n...",
installationId: 123,
clientId: "1234567890abcdef1234",
clientSecret: "1234567890abcdef12341234567890abcdef1234"
}
})
octokit.graphql(query, variables) If you don't want to use Does either work for you? |
let me know if you have further questions |
Hey 👋🏻,
I have a question, we are looking to use this module alongside the @octokit/graphql.js.
We work behind a corporate proxy, so we need to be able to pass a proxy to any egress request from within our network.
I see that both this and the
@octokit/graphql.js
modules use the @octokit/request.js) module to make its requests to the GitHub API.By taking a look at your code, you seem to be using node-fetch for actually making the HTTP Requests behind the scenes.
Taking a look at node-fetch it does support passing in an agent. When taking a look at your request library, there doesn't seem to be any options, which I would have expected to see here? (maybe?)
We would love to be able to pass in a
httpsAgent
somewhere?Something like that? It would be great if we could do this in a single place when looking through the
octokit
modules, it would be great to have a single experience across the@octokit
ecosystem 🤔?Just wanted to put it here and get some of your thoughts on best practice 👍
Thanks for all your help.
The text was updated successfully, but these errors were encountered: