cURL / Mailing Lists / curl-library / Single Mail

curl-library

[PATCH] Support socks proxy specification in "all_proxy" variable

From: <obconseil_at_gmail.com>
Date: Tue, 26 Apr 2011 23:53:59 +0200

Hello,

I did a patch to support the following notation in the "all_proxy" environment variable:

export all_proxy="socks4://myproxy:1080"
export all_proxy="socks4a://myproxy:1080"
export all_proxy="socks5://myproxy:1080"

Without these variables, such a notation were automatically discarded, and the proxy "myproxy" where taken as a HTTP proxy.

I verified the patch, it works against the git HEAD and the debian version 7.21.4 .

However, I found another, unrelated problem linked to the use of HTTP trackers.

When *not* using proxy, a software asking for, for exemple:
http://tracker.torrent.com:5000/24d6209a416486c8d3f00e752b2a96ea/announce?info_hash=%8D%81%CC% (etc...)
The actual text request against the server is:
GET /24d6209a416486c8d3f00e752b2a96ea/announce?info_hash=%8D%81%CC%F7%B9i%F (etc... http header follows, including the Host: tracker.torrent.com:5000 )

But when using the socks proxy, here is what the request is:
GET http://tracker.torrent.com:5000/24d6209a416486c8d3f00e752b2a96ea/announce?info_hash=%8D%81%CC%F7%B9i%F (etc... http header follows also)

The problem is that in the *second* case, the server returns a HTTP 404 error.

I can't see:
1) If the second case is legal/normal, and if no,
2) Where the text URL is build differently in the source when the proxy is ON rather than not.

Anyway, feel free to pickup the patch if you think it's worth it.

OB.Conseil

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html

Received on 2011-04-26