Skip to content

Question: Getting http.proxy to work #1429

Closed
@pushad

Description

@pushad

Hey guys,

I've got a repo set up at bitbucket. This repository is initialized locally with a reference to the http link provided from the site.

I am using LibGit2Sharp 0.23.1, and I am using the following to fetch from the remote server:

private bool fetch()
        {
            string logMessage = "";
            using (var repo = new Repository(settings.directory))
            {
                Remote remote = repo.Network.Remotes["origin"];
                IEnumerable<string> refSpecs = remote.FetchRefSpecs.Select(x => x.Specification);
                FetchOptions options = new FetchOptions();

                options.CredentialsProvider = getCredentials();
                Commands.Fetch(repo, remote.Name, refSpecs, options, logMessage);
            }
            Logger.debug(logMessage);
            return true;
        }

Inside config file of git I have the following added:

[http]
	proxy = http://<IP>:8888

I am using wireshark to sniff my outgoing packets and can confirm that using command-line git fetch, it is indeed using the configured proxy. Removing this setting from the config also confirms that it is not using the proxy. Also at my proxy server I can confirm that there is a connection going to bitbucket when fetching.

However when I use my code, which points to the same location where the repository is sitting at, it does not use the proxy at all. I don't see any packets going to the proxy server in my Wireshark instance, nor in the logs of my proxy server. It is indeed fetching, just directly to the server.

I've googled quite a bit, I've tried setting up environment proxy variable, setting up proxy in Internet Explorer, setting up proxy on remote only. None of them work with my client.

I'm guessing I've got something misconfigured, just not sure what.

Hopefully you guys can help me out!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions