You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by lh...@traversetechnologies.com on 2008/07/02 01:30:56 UTC

Re: Synapse as HTTP Proxy?

This does clarify things a bit. Thanks! If I knew the codebase better I'd volunteer to help implement proxying on the base URL...

-L

-----Original Message-----
From: "Ruwan Linton" <ru...@gmail.com>
Sent: Friday, June 27, 2008 10:16pm
To: user@synapse.apache.org, lharding@traversetechnologies.com
Subject: Re: Synapse as HTTP Proxy?

minor correction please change that URL to the following :-) sorry for the
inconvenience,

http://localhost:8280/soap/__SynapseService<http://localhost:8280/soap/synapse>
http://localhost:8280/soap/__SynapseService/mediate<http://localhost:8280/soap/synapse>

Thanks,
Ruwan

On 6/28/08, Ruwan Linton <ru...@gmail.com> wrote:
>
> Hi Leander,
>
> Well, an interesting idea.... See my comments in-line;
>
> On 6/28/08, lharding@traversetechnologies.com <
> lharding@traversetechnologies.com> wrote:
>>
>> Here's an obscure corner case. Is it possible to use Synapse in the role
>> of an HTTP proxy, or at least have it look like one to clients? What I'm
>> going for is to have Synapse get requests for fully qualified urls (ie, 'GET
>> http://www.example.com/stuff HTTP/1.1') and do it's normal mediation
>> shtick on them.
>
>
> For the moment it is possible with proxy services.
>
> It seems like this is doable with SOAP/POX requests, as Synapse seems to
>> expect HTTP proxy-style POST-with-fully-qualified-url requests when not
>> serving a Synapse <proxy> service.
>
>
> Correct!
>
> However, when doing the same with a GET request, it of course responds with
>> a Moved Permanently redirect to the services index page because it thinks
>> some poor misdirected user is aiming a web browser at the wrong place. I've
>> looked at the ServerWorker class that handles this, and while  hacking out
>> the redirect sending code seems pretty straightforward, the result is then
>> that GET requests of this type just hang (GETting something served by a
>> <proxy> service still works).
>
>
> Well, still this is possible I mean getting the proxy working for GET
> requests without a Synapse <proxy>. You get this behavior because you are
> trying to use the root URL, please try the following URLs,
>
> http://localhost:8280/soap/synapse
> http://localhost:8280/soap/synapse/mediate
>
> At the same time I think we should fix this to serve on the base URL,
> because we do serve for requests over a POST for the base URL. I think this
> can be easily fixed. Let me wait and see what you and others on the
> community think about this...
>
> Is it possible to make Synapse work in this way, or is this just
>> excessively an abuse of what synapse is supposed to do?
>
>
> No, this is not at all an abuse. Well, synapse is designed to do these
> kinds of stuff. Please try the above proposed URLs in your GET request, at
> the same time I will get the fix to the GET request processing so that you
> can do a GET on the base URL as well.
>
> Thanks,
> Ruwan
>
>
> Thanks,
>>
>> -Leander
>>
>>
>
>
> --
> Ruwan Linton
> http://wso2.org - "Oxygenating the Web Services Platform"
> http://ruwansblog.blogspot.com/




-- 
Ruwan Linton
http://wso2.org - "Oxygenating the Web Services Platform"
http://ruwansblog.blogspot.com/



Re: Synapse as HTTP Proxy?

Posted by Ruwan Linton <ru...@gmail.com>.
If you could go ahead and create a JIRA for this I would be more than happy
to get this resolved for you :-)

Thanks,
Ruwan

On Wed, Jul 2, 2008 at 5:00 AM, <lh...@traversetechnologies.com> wrote:

> This does clarify things a bit. Thanks! If I knew the codebase better I'd
> volunteer to help implement proxying on the base URL...
>
> -L
>
> -----Original Message-----
> From: "Ruwan Linton" <ru...@gmail.com>
> Sent: Friday, June 27, 2008 10:16pm
> To: user@synapse.apache.org, lharding@traversetechnologies.com
> Subject: Re: Synapse as HTTP Proxy?
>
> minor correction please change that URL to the following :-) sorry for the
> inconvenience,
>
> http://localhost:8280/soap/__SynapseService<
> http://localhost:8280/soap/synapse>
> http://localhost:8280/soap/__SynapseService/mediate<
> http://localhost:8280/soap/synapse>
>
> Thanks,
> Ruwan
>
> On 6/28/08, Ruwan Linton <ru...@gmail.com> wrote:
> >
> > Hi Leander,
> >
> > Well, an interesting idea.... See my comments in-line;
> >
> > On 6/28/08, lharding@traversetechnologies.com <
> > lharding@traversetechnologies.com> wrote:
> >>
> >> Here's an obscure corner case. Is it possible to use Synapse in the role
> >> of an HTTP proxy, or at least have it look like one to clients? What I'm
> >> going for is to have Synapse get requests for fully qualified urls (ie,
> 'GET
> >> http://www.example.com/stuff HTTP/1.1') and do it's normal mediation
> >> shtick on them.
> >
> >
> > For the moment it is possible with proxy services.
> >
> > It seems like this is doable with SOAP/POX requests, as Synapse seems to
> >> expect HTTP proxy-style POST-with-fully-qualified-url requests when not
> >> serving a Synapse <proxy> service.
> >
> >
> > Correct!
> >
> > However, when doing the same with a GET request, it of course responds
> with
> >> a Moved Permanently redirect to the services index page because it
> thinks
> >> some poor misdirected user is aiming a web browser at the wrong place.
> I've
> >> looked at the ServerWorker class that handles this, and while  hacking
> out
> >> the redirect sending code seems pretty straightforward, the result is
> then
> >> that GET requests of this type just hang (GETting something served by a
> >> <proxy> service still works).
> >
> >
> > Well, still this is possible I mean getting the proxy working for GET
> > requests without a Synapse <proxy>. You get this behavior because you are
> > trying to use the root URL, please try the following URLs,
> >
> > http://localhost:8280/soap/synapse
> > http://localhost:8280/soap/synapse/mediate
> >
> > At the same time I think we should fix this to serve on the base URL,
> > because we do serve for requests over a POST for the base URL. I think
> this
> > can be easily fixed. Let me wait and see what you and others on the
> > community think about this...
> >
> > Is it possible to make Synapse work in this way, or is this just
> >> excessively an abuse of what synapse is supposed to do?
> >
> >
> > No, this is not at all an abuse. Well, synapse is designed to do these
> > kinds of stuff. Please try the above proposed URLs in your GET request,
> at
> > the same time I will get the fix to the GET request processing so that
> you
> > can do a GET on the base URL as well.
> >
> > Thanks,
> > Ruwan
> >
> >
> > Thanks,
> >>
> >> -Leander
> >>
> >>
> >
> >
> > --
> > Ruwan Linton
> > http://wso2.org - "Oxygenating the Web Services Platform"
> > http://ruwansblog.blogspot.com/
>
>
>
>
> --
> Ruwan Linton
> http://wso2.org - "Oxygenating the Web Services Platform"
> http://ruwansblog.blogspot.com/
>
>
>


-- 
Ruwan Linton
http://wso2.org - "Oxygenating the Web Services Platform"
http://ruwansblog.blogspot.com/