cURL / Mailing Lists / curl-users / Single Mail

curl-users

Netscape Proxy inserts extra HTTP response - easy way to avoid this?

From: Simon Liu <macdeveloper_at_gmail.com>
Date: Mon, 7 Mar 2005 23:26:52 +0000

Hi,

My app connects to a Shoutcast MP3 server which does not return HTTP
headers, but instead returns its own custom headers, followed by
binary data. My app uses libcurl with the HTTP_ALIAS option to parse
the custom headers since they are in the same format as HTTP headers.

Some of my users are behind a Netscape Proxy and have discovered that
the proxy inserts its own HTTP response header, before the server's
actual response (which is not HTTP, but with the HTTP_ALIAS option my
app parses it anyway).  I am not sure why the Netscape Proxy does this
but I guess the proxy detects that the server's reponse is missing a
HTTP response, so it constructs one by examining the data. In any
case, this is causing me a problem as libcurl considers the Netscape
Proxy returned headers to be the real headers, and treats the server's
actual response as the body of data.

While this isn't that hard to program around, I'd like to know what
experience others have had with Netscape (or other brand) proxies,
whether or not a general case exists to be tested against, and whether
there is a way to get libcurl to ignore certain responses from a
proxy.

Thanks.  Any advice appreciated.
--Simon

GET http://64.62.149.130:8000/ HTTP/1.1
Host: 64.62.149.130:8000
Accept: */*
Icy-MetaData: 1
User-Agent: iTunes/4.5
Pragma: no-cache

******** Netscape Proxy *********
HTTP/1.0 200 Ok
Proxy-agent: Netscape-Proxy/3.51
Date: Wednesday, 02-Mar-05 23:10:51 GMT
Content-type: audio/mpeg
Via: 1.1 S1PS
******** End Netscape Proxy *********

ICY 200 OK
icy-notice1: ...
... (more headers) ...
...

[binary MP3 data]
Received on 2005-03-08