[prev in list] [next in list] [prev in thread] [next in thread] 

List:       curl-library
Subject:    Re: modify the REMOTE_ADDR part of the http header
From:       Daniel Stenberg <daniel () haxx ! se>
Date:       2001-12-19 9:44:30
[Download RAW message or body]

On Wed, 19 Dec 2001, Sangeetha Naik wrote:

> I am trying to modify the REMOTE_ADDR part of the http header for an http
> post. This is the script I used. Its written in perl with the Curl::easy
> module

Eh. I think you're confusing things here. There is no header named
'REMOTE_ADDR' in a regular HTTP request (be it get or post or others).

REMOTE_ADDR is usually an enviornment variable set by the web server before
CGI scripts/programs are invoked. The address it picks is probably picked
from the IP layer.

While you *can* set a header named that with curl, I don't think it'll make
any difference at all to what the environment variable will be set to.

> As you can see I am using CURLOPT_HTTPHEADER to modify the REMOTE_ADDR
> variable. But it does not really change that variable on the other side.
> However I am have been successful in changing the HTTP_REFERER and
> HTTP_USER_AGENT variables using CURLOPT_REFERER and CURLOPT_USERAGENT

Yes, as the 'HTTP' prefix suggests, those variables are picked from the HTTP
request itself. The ones without HTTP prefix are not.

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic