Skip to content

Conversation

alexcrichton
Copy link
Member

Due to libgit2 not supporting HTTP proxies, the custom transport API of the
library must be used to reimplement the HTTP transport with proxy support. The
git2-curl crate implements this transport on top of the curl-rust crate. By
using libcurl we gain all sorts of proxy support for free.

This transport is not used by default, however, as it is not well battle tested
and the architecture is not currently ideal (download the entire repo into
memory on a clone). Only when an HTTP proxy is present is the new transport
used.

The other drawback of git2-curl is that it does not currently support
authentication. If a private git repository is cloned or authentication is
required then it will generate an error instead of correctly asking for
credentials.

Closes #636

Due to libgit2 not supporting HTTP proxies, the custom transport API of the
library must be used to reimplement the HTTP transport with proxy support. The
git2-curl crate implements this transport on top of the curl-rust crate. By
using libcurl we gain all sorts of proxy support for free.

This transport is not used by default, however, as it is not well battle tested
and the architecture is not currently ideal (download the entire repo into
memory on a clone). Only when an HTTP proxy is present is the new transport
used.

The other drawback of git2-curl is that it does not currently support
authentication. If a private git repository is cloned or authentication is
required then it will generate an error instead of correctly asking for
credentials.

Closes rust-lang#636
@rust-highfive
Copy link

r? @huonw

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member Author

cc @wycats, @brson

@huonw
Copy link
Contributor

huonw commented Feb 10, 2015

Maybe you could add a config option to enable this without a proxy? (I'd be happy to enable it to help test, but setting up a proxy is annoying...)

@alexcrichton
Copy link
Member Author

Unfortunately if you have a proxy then Cargo doesn't work at all because we use git for the index (which even the registry needs). In that sense this is a strict improvement over what we currently have!

I've been currently testing with:

$ ssh -vgND 3128 some-host-with-internet
$ HTTP_PROXY=socks5a://localhost:3128 ./target/x86_64-unknown-linux-gnu/cargo build

(using ssh as a SOCKS proxy isn't so bad)

@huonw
Copy link
Contributor

huonw commented Feb 12, 2015

@bors r+ b20b

@bors
Copy link
Contributor

bors commented Feb 12, 2015

⌛ Testing commit b20b0f6 with merge 0b84923...

bors added a commit that referenced this pull request Feb 12, 2015
Due to libgit2 not supporting HTTP proxies, the custom transport API of the
library must be used to reimplement the HTTP transport with proxy support. The
git2-curl crate implements this transport on top of the curl-rust crate. By
using libcurl we gain all sorts of proxy support for free.

This transport is not used by default, however, as it is not well battle tested
and the architecture is not currently ideal (download the entire repo into
memory on a clone). Only when an HTTP proxy is present is the new transport
used.

The other drawback of git2-curl is that it does not currently support
authentication. If a private git repository is cloned or authentication is
required then it will generate an error instead of correctly asking for
credentials.

Closes #636
@bors
Copy link
Contributor

bors commented Feb 12, 2015

☀️ Test successful - cargo-linux-32, cargo-linux-64, cargo-mac-32, cargo-mac-64, cargo-win-32, cargo-win-64

@bors bors merged commit b20b0f6 into rust-lang:master Feb 12, 2015
@alexcrichton alexcrichton deleted the issue-636 branch March 2, 2015 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cargo behind a proxy
4 participants