Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm accessing an http resource using Chrome, FoxyProxy without any problems. The proxy is defined as socks5 in the standard port 1080.

I've tried accessing the same resource using cURL (actual URLs changed for privacy reasons):

$ curl -vvv -socks5 SOCKS_SERVER:1080 -X GET "THE_URL_FROM_BROWSER"

And got:

* About to connect() to SOCKS_SERVER port 1080 (#0)
*   Trying IP... connected
* Connected to SOCKS_SERVER (IP) port 1080 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5
> Host: SOCKS_SERVER:1080
> Accept: */*
> 
* Empty reply from server
* Connection #0 to host SOCKS_SERVER left intact
* Connection #0 seems to be dead!
* Closing connection #0
* About to connect() to URL_HOST port 80 (#0)
*   Trying SOME_IP...

Which never comes back with a response.

Any idea why cURL can't access the same resource accessed by FoxyProxy?

share|improve this question
add comment

1 Answer 1

I get the same result, and looking at the strace output, it tries to connect to URL_HOST directly.

However if I use

curl -x socks5://SOCKS_SERVER:1080 "THE_URL_FROM_BROWSER"

It does work as expected (use socks4a or socks5h to have hostnames resolved by the proxy, if supported)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.