Skip to content
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

specifying a proxy when connecting to a GitHub Enterprise server #809

Closed
shiftkey opened this issue May 31, 2015 · 6 comments
Closed

specifying a proxy when connecting to a GitHub Enterprise server #809

shiftkey opened this issue May 31, 2015 · 6 comments
Labels
Status: Stale Used by stalebot to clean house Type: Feature New feature or request

Comments

@shiftkey
Copy link
Member

Found this while looking at #808.

It's currently rather hard to do cry: (you need to specify all the parameter), and I'm not sure if anyone depends on this.

Please comment on this if it impacts you, and I'll adjust it in my priority queue. See #781 for other discussions about how Octokit plans to adapt it's usage of HttpMessageHandler to support more flexibility...

@squeakyD
Copy link

It's still not fixed for Github Enterprise. Please could this be revisited?

http://octokitnet.readthedocs.io/en/latest/http-client/

@ryangribble
Copy link
Contributor

Hmmm this pre-dates my involvement, I can see mentions of it not working for enterprise but no detail as to how/why its not working

So to clarify, is the problem that following redirects doesn't work for GHE in a proxied environment, or actually that NOTHING works when behind a proxy?

I'm not sure how to test this either, thankfully we got rid of web proxies at my work! 😁

Happy to review a pull request though if you are able to debug in your environment and make a change that works for you...

@squeakyD
Copy link

The reason why this doesn't work is because what I need to do is pass in the GHE URL, i.e.

var client = new GitHubClient(new ProductHeaderValue("my-cool-app"), new Uri("https:// .... "));

However only the way you can currently add a proxy in code is:

`
var proxy = new WebProxy(new Uri("http://proxyarray.service.group:8080"), true);
proxy.Credentials = CredentialCache.DefaultCredentials;
IHttpClient httpClient = (IHttpClient)HttpMessageHandlerFactory.CreateDefault(proxy);

        var connection = new Connection(new ProductHeaderValue("my-cool-app"),
            new HttpClientAdapter(() => HttpMessageHandlerFactory.CreateDefault(proxy)));
        var client = new GitHubClient(connection);

The problem is that there is no constructor that can take an IConnection and a URL.

@olegkap
Copy link

olegkap commented May 14, 2018

You can also provide a handler directly:

                var connection = new Connection(
                    new ProductHeaderValue("my-cool-app"),
                    new HttpClientAdapter(() => new HttpClientHandler {
                        Proxy = new WebProxy(this.Configuration["Proxy:Address"]),
                        UseProxy = true
                    }));
                var client = new GitHubClient(connection);

@BanksySan
Copy link

Is there a solution for this yet? There doesn't seem to be a way to use a proxy and supply credentials.

@nickfloyd nickfloyd added Type: Feature New feature or request and removed category: feature labels Oct 27, 2022
@github-actions
Copy link

github-actions bot commented Aug 3, 2023

👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

@github-actions github-actions bot added the Status: Stale Used by stalebot to clean house label Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Stale Used by stalebot to clean house Type: Feature New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants