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

Cargo behind SOCKS proxy #3596

Closed
kornelski opened this issue Jan 26, 2017 · 2 comments
Closed

Cargo behind SOCKS proxy #3596

kornelski opened this issue Jan 26, 2017 · 2 comments

Comments

@kornelski
Copy link
Contributor

kornelski commented Jan 26, 2017

I have to use a SOCKS proxy (the kind created by ssh -D). The documentation doesn't say whether/how SOCKS is supported:

proxy = "..." # HTTP proxy to use for HTTP requests (defaults to none)

I've tried changing config, as mentioned in #636, but Cargo seems to assume the proxy is a HTTP proxy. I've tried:

[http]
proxy = "socks://localhost:9050"
[https]
proxy = "socks://localhost:9050"

but that's not enough:

cargo run
Updating registry https://github.com/rust-lang/crates.io-index
warning: spurious network error (2 tries remaining): [12/-2] [6] Couldn't resolve host name (Could not resolve host: github.com)
warning: spurious network error (1 tries remaining): [12/-2] [6] Couldn't resolve host name (Could not resolve host: github.com)
error: failed to load source for a dependency on vpsearch

Caused by:
Unable to update registry https://github.com/rust-lang/crates.io-index

Caused by:
failed to fetch https://github.com/rust-lang/crates.io-index

Are SOCKS proxies supported?

@alexcrichton
Copy link
Member

I believe the syntax for libcurl is the socks5 or socks5h protocol (e.g. socks5://localhost:9050). Does that work?

@kornelski
Copy link
Contributor Author

socks5h worked, thank you!

kornelski added a commit to kornelski/cargo that referenced this issue Jan 26, 2017
bors added a commit that referenced this issue Jan 27, 2017
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

No branches or pull requests

2 participants