Plans/intents over multiple bindings/modules

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Plans/intents over multiple bindings/modules

mhaemmerle
Hej,

as far as i see it, it's not possible to route requests to bindings depending on their plan/intent as the choice for that has already been made when binding the server. Or am I wrong here?

I need to run netty (for serving socket connections) and jetty (for serving static resources) under the same port and either should answer depending on the context. Any really rough idea on how to do this (in unfiltered or bare-bones)?

Cheers,
Marc
Reply | Threaded
Open this post in threaded view
|

Re: Plans/intents over multiple bindings/modules

n8han
Administrator
On 06/08/2011 12:15 PM, mhaemmerle [via Databinder] wrote:
> as far as i see it, it's not possible to route requests to bindings
> depending on their plan/intent as the choice for that has already been
> made when binding the server. Or am I wrong here?

I don't think it's possible to bind jetty and netty to the same network
interface and port, with or without Unfiltered.

> I need to run netty (for serving socket connections) and jetty (for
> serving static resources) under the same port and either should answer
> depending on the context. Any really rough idea on how to do this (in
> unfiltered or bare-bones)?

I would put them both behind apache with mod-proxy, assuming your netty
socket connections are standard HTTP. And then you don't really need
jetty, you can use apache to serve the static content.

If what you are doing with netty can't be proxied by apache, I think
you're going to have to hack together a static file server for netty.
And if that works out we'd love to add it to Unfiltered. :)

Nathan
Reply | Threaded
Open this post in threaded view
|

Re: Plans/intents over multiple bindings/modules

mhaemmerle
> I don't think it's possible to bind jetty and netty to the same network interface and port, with or without Unfiltered.

I was thinking more along the lines of having netty as some kind of proxy in front of all the bindings and then routing requests internally. But thats probably total overkill.

> If what you are doing with netty can't be proxied by apache, I think
you're going to have to hack together a static file server for netty.

I was afraid you'd say that ;)

Right now I'am kinda torn between proxying requests that would hit to a configured resource path in netty to some static file server or implementing a static file server with netty itself. For the first one speaks more flexibility and not re-inventing the wheel again, for the second one ease of deployment and ease of usage.

Marc