HTTP Proxy

View: New views
4 Messages — Rating Filter:   Alert me  

HTTP Proxy

by Anatoli Kuzmin-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

I tried to use mule as simple http proxy
but I have the several problems
1. request cookies did not send to server 
2. server set cookies, but mule response contains only cookie
3. server returned content type text/xml, mule response - text/plain

I attached configuration and test case.
Could you please help me?

the main part of configuration

    <http:connector name="httpConnector" enableCookies="true"/>
    <http:endpoint name="clientEndpoint" address="http://localhost:4019" synchronous="true"/>
    <http:endpoint name="serverEndpoint" address="http://localhost:4020" synchronous="true"/>

    <model name="main">

        <service name="HttpProxyService">
            <inbound>
                <inbound-endpoint ref="clientEndpoint"/>
            </inbound>
            <outbound>
                <pass-through-router>
                    <outbound-endpoint ref="serverEndpoint">
                    </outbound-endpoint>
                </pass-through-router>
            </outbound>
        </service>

    </model>



--
Best regards,
Anatoli Kuzmin

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesource.org/schema/mule/core/2.2"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:spring="http://www.springframework.org/schema/beans"
      xmlns:stdio="http://www.mulesource.org/schema/mule/stdio/2.2"
      xmlns:http="http://www.mulesource.org/schema/mule/http/2.2"
      xmlns:test="http://www.mulesource.org/schema/mule/test/2.2"
      xmlns:xm="http://www.mulesource.org/schema/mule/xml/2.2"
      xsi:schemaLocation="
    http://www.mulesource.org/schema/mule/stdio/2.2 http://www.mulesource.org/schema/mule/stdio/2.2/mule-stdio.xsd
       http://www.mulesource.org/schema/mule/test/2.2 http://www.mulesource.org/schema/mule/test/2.2/mule-test.xsd
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
       http://www.mulesource.org/schema/mule/core/2.2 http://www.mulesource.org/schema/mule/core/2.2/mule.xsd
       http://www.mulesource.org/schema/mule/xml/2.2 http://www.mulesource.org/schema/mule/xml/2.2/mule-xml.xsd
       http://www.mulesource.org/schema/mule/http/2.2 http://www.mulesource.org/schema/mule/http/2.2/mule-http.xsd">

    <http:connector name="httpConnector" enableCookies="true"/>

    <http:endpoint name="clientEndpoint" address="http://localhost:4019" synchronous="true"/>
    <http:endpoint name="serverEndpoint" address="http://localhost:4020" synchronous="true"/>

    <model name="main">

        <service name="HttpProxyService">
            <inbound>
                <inbound-endpoint ref="clientEndpoint"/>
            </inbound>
            <outbound>
                <pass-through-router>
                    <outbound-endpoint ref="serverEndpoint">
                    </outbound-endpoint>
                </pass-through-router>
            </outbound>
        </service>

    </model>

</mule>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

HttpFunctionalTestCase.java (7K) Download Attachment

Re: HTTP Proxy

by Anatoli Kuzmin-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Reason of the problem "Only one cookie":
HttpClient sends cookies in multiply headers "Cookie"
Mule stores them in Map as a result lost prev headers. The same problem for Set-Cookie

Solution http client (only for sender)
set http.protocol.single-cookie-header to true
http://hc.apache.org/httpclient-3.x/preference-api.html


On Tue, Jun 30, 2009 at 3:28 PM, Anatoli Kuzmin <anatoli.kuzmin@...> wrote:
Hi

I tried to use mule as simple http proxy
but I have the several problems
1. request cookies did not send to server 
2. server set cookies, but mule response contains only cookie
3. server returned content type text/xml, mule response - text/plain

I attached configuration and test case.
Could you please help me?

the main part of configuration

    <http:connector name="httpConnector" enableCookies="true"/>
    <http:endpoint name="clientEndpoint" address="http://localhost:4019" synchronous="true"/>
    <http:endpoint name="serverEndpoint" address="http://localhost:4020" synchronous="true"/>

    <model name="main">

        <service name="HttpProxyService">
            <inbound>
                <inbound-endpoint ref="clientEndpoint"/>
            </inbound>
            <outbound>
                <pass-through-router>
                    <outbound-endpoint ref="serverEndpoint">
                    </outbound-endpoint>
                </pass-through-router>
            </outbound>
        </service>

    </model>



--
Best regards,
Anatoli Kuzmin



--
Best regards,
Anatoli Kuzmin

Parent Message unknown Re: Re: HTTP Proxy

by Andrew Perepelytsya :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Anatoli, welcome back :)

Could you please file a jira for this?
Andrew

On Jun 30, 2009 8:50 AM, "Anatoli Kuzmin" <anatoli.kuzmin@...> wrote:

Reason of the problem "Only one cookie":
HttpClient sends cookies in multiply headers "Cookie"
Mule stores them in Map as a result lost prev headers. The same problem for Set-Cookie

Solution http client (only for sender)
set http.protocol.single-cookie-header to true
http://hc.apache.org/httpclient-3.x/preference-api.html

On Tue, Jun 30, 2009 at 3:28 PM, Anatoli Kuzmin <anatoli.kuzmin@...> wrote: > > Hi > > I t...

--
Best regards,
Anatoli Kuzmin


Re: Re: HTTP Proxy

by Anatoli Kuzmin-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Andrew,

Thanks!

Done
Cookies are lost on endpoints http://www.mulesource.org/jira/browse/MULE-4418
 Incorrect contentType on sync endpoint http://www.mulesource.org/jira/browse/MULE-4419




On Tue, Jun 30, 2009 at 5:12 PM, Andrew Perepelytsya <aperepel@...> wrote:

Hi Anatoli, welcome back :)

Could you please file a jira for this?
Andrew

On Jun 30, 2009 8:50 AM, "Anatoli Kuzmin" <anatoli.kuzmin@...> wrote:

Reason of the problem "Only one cookie":
HttpClient sends cookies in multiply headers "Cookie"
Mule stores them in Map as a result lost prev headers. The same problem for Set-Cookie

Solution http client (only for sender)
set http.protocol.single-cookie-header to true
http://hc.apache.org/httpclient-3.x/preference-api.html

On Tue, Jun 30, 2009 at 3:28 PM, Anatoli Kuzmin <anatoli.kuzmin@...> wrote: > > Hi > > I t...

--
Best regards,
Anatoli Kuzmin



--
Best regards,
Anatoli Kuzmin