You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Greg Wilkins <gr...@intalio.com> on 2011/08/09 08:49:16 UTC

websocket support for mod_proxy

Is there any plans to implement websocket support in mod_proxy.   I
would think that it could be done pretty simply as a variation of
mod_proxy_connect, as once the HTTP upgrade is done mod_proxy can
treat the connection as a simple byte tunnel.

I develop the jetty HTTP client/server which supports websocket and
would be happy to work with anybody developing mod_proxy_websocket to
provide a test environment.

cheers

Re: websocket support for mod_proxy

Posted by Greg Wilkins <gr...@intalio.com>.
Rainer,

On 9 August 2011 19:48, Rainer Jung <ra...@kippdata.de> wrote:
> Greg: since you are part of the hybi discussion: do you see any benefit
> of having Apache in the loop after the initial websocket handshake?

I can see benefits of both approaches.

If the fd can be passed, then that will give maximum performance.
However, it is also likely that httpd will be run on a different
system, so the proxy mode will be needed.

Also, eventually there might be a role for apache to actually examine
websocket frames to add value to them - eg implement extension for
mux, ssl, compression etc.

regards

Re: websocket support for mod_proxy

Posted by Torsten Förtsch <to...@gmx.net>.
On Tuesday, 09 August 2011 11:48:32 Rainer Jung wrote:
> Another option would be something like mod_proxy_fdpass, namely once
> we observe a websocket is started, hand over the full connection via
> the file descriptor to some other dedicated websocket server. I
> haven't checked though, whether the mod_proxy_fdpass way of doing it
> would interoperate with a Java based websocket server.

A recent modperl allows to do something along these lines even with httpd 
2.0, http://foertsch.name/ModPerl-Tricks/req-hand-over.shtml

Torsten Förtsch

-- 
Need professional modperl support? Hire me! (http://foertsch.name)

Like fantasy? http://kabatinte.net

Re: websocket support for mod_proxy

Posted by Rainer Jung <ra...@kippdata.de>.
On 09.08.2011 08:49, Greg Wilkins wrote:
> Is there any plans to implement websocket support in mod_proxy.   I
> would think that it could be done pretty simply as a variation of
> mod_proxy_connect, as once the HTTP upgrade is done mod_proxy can
> treat the connection as a simple byte tunnel.
> 
> I develop the jetty HTTP client/server which supports websocket and
> would be happy to work with anybody developing mod_proxy_websocket to
> provide a test environment.

Another option would be something like mod_proxy_fdpass, namely once we
observe a websocket is started, hand over the full connection via the
file descriptor to some other dedicated websocket server. I haven't
checked though, whether the mod_proxy_fdpass way of doing it would
interoperate with a Java based websocket server.

Note that mod_proxy_fdpass is part of the dev version Apache 2.3 which
is currently in beta status, but we all think GA of 2.4 is not far away.

When solving the problem similar to mod_proxy_connect, the web server
would stay in the loop for the whole communication and it seems
questionable whether there's any benefit for that - at least if a
websocket server is running on the same system.

If the websocket server is only available remotely from the proxy, then
of course there's a need for a proxy for the whole duration of the
communication, but again it is questionable, what the benefit of using
Apache for it is. We could as well hand off to a general port forwarding
mechanism.

Greg: since you are part of the hybi discussion: do you see any benefit
of having Apache in the loop after the initial websocket handshake?

Regards,

Rainer