cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Possible patch about http custom header is used for proxy connection

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 8 Sep 2012 23:04:20 +0200 (CEST)

On Thu, 6 Sep 2012, Dan Fandrich wrote:

>> I would like to introduce a complement to CURLOPT_HTTPHEADER that is used
>> only for CONNECT requests. Called CURLOPT_PROXYHEADER or
>> CURLOPT_CONNECTHEADER perhaps.
>
> Backwards compatibility would be an issue. But if you keep the current
> behaviour until the app sets a CURLOPT_CONNECTHEADER (even to set a dummy or
> NULL header), it ought to work.

A good idea indeed. I think it works.

I've started fiddling with this feature now, and I think I'm leaning towards
making the option called CURLOPT_PROXYHEADER so that it specifies headers to
use when working against a proxy which then makes it independent of it being
CONNECT or any other request. I think this is a good idea for two reasons:

1 - the libcurl internals already separate those two cases very good so it
makes it slightly easier to add this feature. Only doing it for CONNECT will
require more changes.

2 - Some applications may want to differ between regular and proxy requests
and since libcurl has a proxy selection process by itself it isn't easy for an
application to know by itself if the request is going to a host or a proxy.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-09-08