httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Stern <marc.st...@approach.be>
Subject Re: Using mod_proxy from another module
Date Wed, 21 Feb 2007 09:50:06 GMT
Is it also possible to make a post with this ?
This is what I need.


Jim Jagielski wrote:
>> How could we use mod_proxy for outgoing connections from another 
>> module ?
>> Is there any simple way ?
>> Is there any standard (I mean documented) way, or would it rely on 
>> internals only ? In the latter case, we would have to recode 
>> everything when mod_proxy changes.
>>
>
> You would do something like this:
>
>     rr = ap_sub_req_method_uri("OPTIONS", "*", r, NULL); /* this MUST 
> succeed! */
>     apr_snprintf(newurl, sizeof(newurl),
>                 "proxy:%s://%s:%d/%s",
>                 protocol, sendToIP, sendToPort, myURL);
>     ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
>                                 "query constructed: %s", newurl);
>     rr->filename = apr_pstrdup(r->pool, newurl);
>     rr->proxyreq = PROXYREQ_REVERSE;
>     rr->handler  = "proxy-server";
>     ap_run_sub_req(rr);
>
> and then use the response as needed... The above I've used
> in some where I'm just interested in getting some backend
> header info...
>

Mime
View raw message