You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Marc Stern <ma...@approach.be> on 2007/03/01 08:48:38 UTC

Re: Using mod_proxy from another module

I can't find how to do that, could you help me ?

Thanks,

Marc
 
*//*

Jim Jagielski wrote:
> Yep. No problem.
>
> On Feb 21, 2007, at 4:50 AM, Marc Stern wrote:
>
>> 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...
>>>
>>
>
>