You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Maxim Solodovnik <so...@gmail.com> on 2014/02/06 15:17:10 UTC

Re: Web Sockets proxying

Hello Martin,

I have asked HTTPD mailing thread:
http://httpd.markmail.org/thread/zohvqeokryvigpjn
It seems to be impossible to set proxy on protocol basis.

Maybe it would be possible to do the following:
create mapping "/ws" inside the application
make websocket URL to be "ws://host:port/app/ws" on my home page

Thanks in advance


On Tue, Jan 28, 2014 at 3:53 PM, Martin Grigorov <mg...@apache.org>wrote:

> Hi Maxim,
>
> You should ask in HTTPD mailing lists. Or whoever maintains
> mod_proxy_wstunnel.
> If you split http and ws to be in different mappings (e.g. /openmeetings
> (for http) and /ws-openmeetings (for ws)) then you will have to use two
> <filter> elements in your web.xml, one with WicketFilter and another with
> JettyWebSocketFilter. The problem here is that both of them will have their
> own Application and Session instances.
>
> I think it should be easy for HTTPD to differentiate between the protocols
> and use the correct proxy settings.
> If they cannot see the difference in the protocols then they won't see any
> difference in the url path too :)
>
> Please let us know when you have some progress!
>
> Martin Grigorov
> Wicket Training and Consulting
>
>
> On Tue, Jan 28, 2014 at 3:24 AM, Maxim Solodovnik <solomax666@gmail.com
> >wrote:
>
> > Thanks for the quick answer Paul,
> >
> > Segmentation fault is definitely caused by me, but I was not sure if it
> is
> > compilation issue or bacuse of my configuration.
> >
> > I currently have Apache config like this:
> >
> >         #WEBSOCKETS
> >        ProxyPass /openmeetings ws://localhost:5080/openmeetings retry=0
> >        ProxyPassReverse /openmeetings ws://localhost:5080/openmeetings
> > retry=0
> >
> >         ProxyPass /openmeetings http://localhost:5080/openmeetings
> >         ProxyPassReverse /openmeetings
> http://localhost:5080/openmeetings
> >
> > As you can see WebSockets mapping is the same as main app mapping (only
> > protocol part differs)
> > I'm afraid segmentation fault might be caused by normal HTML requests
> > coming instead of WebSocket requests ....
> >
> > This is why I'm asking is there any option to make WebSocket URL differ
> > than main app URL?
> >
> >
> > On Tue, Jan 28, 2014 at 4:27 AM, Paul Bors <pa...@bors.ws> wrote:
> >
> > > I don't think segmentation faults fall (no pun intended) under Wicket
> :)
> > >
> > > You might want to look for help under the Unbuntu's user mailing lists
> > > and/or search on Google.
> > > Here's a starting point for you:
> > >
> > >
> >
> http://www.amoss.me.uk/2013/06/apache-2-2-websocket-proxying-ubuntu-mod_proxy_wstunnel/
> > >
> > >
> > > On Mon, Jan 27, 2014 at 12:42 PM, Maxim Solodovnik <
> solomax666@gmail.com
> > > >wrote:
> > >
> > > > Hello All,
> > > > Is there any way to perform proxying of web sockets?
> > > >
> > > > I have tried mod_proxy_wstunnel but with no luck due to
> > > > 1) I might compile something to very stable (Segmentation fault under
> > > > Ubuntu 13.10 HTTP 2.4.6)
> > > > 2) both main app and ws URL are looks the same:
> > > > http://localhost/openmeetings and ws://localhost/openmeetings.
> > > >
> > > > Should I create additional page/mapping for performing ws tunneling?
> > > > Maybe anyone can share example config/how to?
> > > >
> > > > Thanks in advance :)
> > > >
> > > > --
> > > > WBR
> > > > Maxim aka solomax
> > > >
> > >
> >
> >
> >
> > --
> > WBR
> > Maxim aka solomax
> >
>



-- 
WBR
Maxim aka solomax

Re: Web Sockets proxying

Posted by Maxim Solodovnik <so...@gmail.com>.
Hello All,

Finally I was able to talk to Jim Jagielski and he pointed me to the
solution:
        <Location /foo>
                Order allow,deny
                Allow from all

                ProxyPassReverse http://localhost:8080/foo
                ProxyPass ws://demo.foo.org:8080/foo
        </Location>

The mapping above will allow proxy both http and websocket requests

Maybe someone will find it useful



On Thu, Feb 6, 2014 at 7:33 AM, Martin Grigorov <mg...@apache.org>wrote:

> Hi Maxim,
>
> It is shame that none of the HTTPD developers responded.
> It looks Eric Covener knows as much as I do about mod_proxy_wstunnel ...
> If it wasn't possible to make the difference between the protocols then the
> web server won't be able to decide whether to use WebSocket endpoint or
> http servlet/filter to call the application code.
>
> Sorry that I cannot help you more.
>
> Martin Grigorov
> Wicket Training and Consulting
>
>
> On Thu, Feb 6, 2014 at 3:17 PM, Maxim Solodovnik <solomax666@gmail.com
> >wrote:
>
> > Hello Martin,
> >
> > I have asked HTTPD mailing thread:
> > http://httpd.markmail.org/thread/zohvqeokryvigpjn
> > It seems to be impossible to set proxy on protocol basis.
> >
> > Maybe it would be possible to do the following:
> > create mapping "/ws" inside the application
> > make websocket URL to be "ws://host:port/app/ws" on my home page
> >
> > Thanks in advance
> >
> >
> > On Tue, Jan 28, 2014 at 3:53 PM, Martin Grigorov <mgrigorov@apache.org
> > >wrote:
> >
> > > Hi Maxim,
> > >
> > > You should ask in HTTPD mailing lists. Or whoever maintains
> > > mod_proxy_wstunnel.
> > > If you split http and ws to be in different mappings (e.g.
> /openmeetings
> > > (for http) and /ws-openmeetings (for ws)) then you will have to use two
> > > <filter> elements in your web.xml, one with WicketFilter and another
> with
> > > JettyWebSocketFilter. The problem here is that both of them will have
> > their
> > > own Application and Session instances.
> > >
> > > I think it should be easy for HTTPD to differentiate between the
> > protocols
> > > and use the correct proxy settings.
> > > If they cannot see the difference in the protocols then they won't see
> > any
> > > difference in the url path too :)
> > >
> > > Please let us know when you have some progress!
> > >
> > > Martin Grigorov
> > > Wicket Training and Consulting
> > >
> > >
> > > On Tue, Jan 28, 2014 at 3:24 AM, Maxim Solodovnik <
> solomax666@gmail.com
> > > >wrote:
> > >
> > > > Thanks for the quick answer Paul,
> > > >
> > > > Segmentation fault is definitely caused by me, but I was not sure if
> it
> > > is
> > > > compilation issue or bacuse of my configuration.
> > > >
> > > > I currently have Apache config like this:
> > > >
> > > >         #WEBSOCKETS
> > > >        ProxyPass /openmeetings ws://localhost:5080/openmeetings
> retry=0
> > > >        ProxyPassReverse /openmeetings
> ws://localhost:5080/openmeetings
> > > > retry=0
> > > >
> > > >         ProxyPass /openmeetings http://localhost:5080/openmeetings
> > > >         ProxyPassReverse /openmeetings
> > > http://localhost:5080/openmeetings
> > > >
> > > > As you can see WebSockets mapping is the same as main app mapping
> (only
> > > > protocol part differs)
> > > > I'm afraid segmentation fault might be caused by normal HTML requests
> > > > coming instead of WebSocket requests ....
> > > >
> > > > This is why I'm asking is there any option to make WebSocket URL
> differ
> > > > than main app URL?
> > > >
> > > >
> > > > On Tue, Jan 28, 2014 at 4:27 AM, Paul Bors <pa...@bors.ws> wrote:
> > > >
> > > > > I don't think segmentation faults fall (no pun intended) under
> Wicket
> > > :)
> > > > >
> > > > > You might want to look for help under the Unbuntu's user mailing
> > lists
> > > > > and/or search on Google.
> > > > > Here's a starting point for you:
> > > > >
> > > > >
> > > >
> > >
> >
> http://www.amoss.me.uk/2013/06/apache-2-2-websocket-proxying-ubuntu-mod_proxy_wstunnel/
> > > > >
> > > > >
> > > > > On Mon, Jan 27, 2014 at 12:42 PM, Maxim Solodovnik <
> > > solomax666@gmail.com
> > > > > >wrote:
> > > > >
> > > > > > Hello All,
> > > > > > Is there any way to perform proxying of web sockets?
> > > > > >
> > > > > > I have tried mod_proxy_wstunnel but with no luck due to
> > > > > > 1) I might compile something to very stable (Segmentation fault
> > under
> > > > > > Ubuntu 13.10 HTTP 2.4.6)
> > > > > > 2) both main app and ws URL are looks the same:
> > > > > > http://localhost/openmeetings and ws://localhost/openmeetings.
> > > > > >
> > > > > > Should I create additional page/mapping for performing ws
> > tunneling?
> > > > > > Maybe anyone can share example config/how to?
> > > > > >
> > > > > > Thanks in advance :)
> > > > > >
> > > > > > --
> > > > > > WBR
> > > > > > Maxim aka solomax
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > WBR
> > > > Maxim aka solomax
> > > >
> > >
> >
> >
> >
> > --
> > WBR
> > Maxim aka solomax
> >
>



-- 
WBR
Maxim aka solomax

Re: Web Sockets proxying

Posted by Martin Grigorov <mg...@apache.org>.
Hi Maxim,

It is shame that none of the HTTPD developers responded.
It looks Eric Covener knows as much as I do about mod_proxy_wstunnel ...
If it wasn't possible to make the difference between the protocols then the
web server won't be able to decide whether to use WebSocket endpoint or
http servlet/filter to call the application code.

Sorry that I cannot help you more.

Martin Grigorov
Wicket Training and Consulting


On Thu, Feb 6, 2014 at 3:17 PM, Maxim Solodovnik <so...@gmail.com>wrote:

> Hello Martin,
>
> I have asked HTTPD mailing thread:
> http://httpd.markmail.org/thread/zohvqeokryvigpjn
> It seems to be impossible to set proxy on protocol basis.
>
> Maybe it would be possible to do the following:
> create mapping "/ws" inside the application
> make websocket URL to be "ws://host:port/app/ws" on my home page
>
> Thanks in advance
>
>
> On Tue, Jan 28, 2014 at 3:53 PM, Martin Grigorov <mgrigorov@apache.org
> >wrote:
>
> > Hi Maxim,
> >
> > You should ask in HTTPD mailing lists. Or whoever maintains
> > mod_proxy_wstunnel.
> > If you split http and ws to be in different mappings (e.g. /openmeetings
> > (for http) and /ws-openmeetings (for ws)) then you will have to use two
> > <filter> elements in your web.xml, one with WicketFilter and another with
> > JettyWebSocketFilter. The problem here is that both of them will have
> their
> > own Application and Session instances.
> >
> > I think it should be easy for HTTPD to differentiate between the
> protocols
> > and use the correct proxy settings.
> > If they cannot see the difference in the protocols then they won't see
> any
> > difference in the url path too :)
> >
> > Please let us know when you have some progress!
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> >
> >
> > On Tue, Jan 28, 2014 at 3:24 AM, Maxim Solodovnik <solomax666@gmail.com
> > >wrote:
> >
> > > Thanks for the quick answer Paul,
> > >
> > > Segmentation fault is definitely caused by me, but I was not sure if it
> > is
> > > compilation issue or bacuse of my configuration.
> > >
> > > I currently have Apache config like this:
> > >
> > >         #WEBSOCKETS
> > >        ProxyPass /openmeetings ws://localhost:5080/openmeetings retry=0
> > >        ProxyPassReverse /openmeetings ws://localhost:5080/openmeetings
> > > retry=0
> > >
> > >         ProxyPass /openmeetings http://localhost:5080/openmeetings
> > >         ProxyPassReverse /openmeetings
> > http://localhost:5080/openmeetings
> > >
> > > As you can see WebSockets mapping is the same as main app mapping (only
> > > protocol part differs)
> > > I'm afraid segmentation fault might be caused by normal HTML requests
> > > coming instead of WebSocket requests ....
> > >
> > > This is why I'm asking is there any option to make WebSocket URL differ
> > > than main app URL?
> > >
> > >
> > > On Tue, Jan 28, 2014 at 4:27 AM, Paul Bors <pa...@bors.ws> wrote:
> > >
> > > > I don't think segmentation faults fall (no pun intended) under Wicket
> > :)
> > > >
> > > > You might want to look for help under the Unbuntu's user mailing
> lists
> > > > and/or search on Google.
> > > > Here's a starting point for you:
> > > >
> > > >
> > >
> >
> http://www.amoss.me.uk/2013/06/apache-2-2-websocket-proxying-ubuntu-mod_proxy_wstunnel/
> > > >
> > > >
> > > > On Mon, Jan 27, 2014 at 12:42 PM, Maxim Solodovnik <
> > solomax666@gmail.com
> > > > >wrote:
> > > >
> > > > > Hello All,
> > > > > Is there any way to perform proxying of web sockets?
> > > > >
> > > > > I have tried mod_proxy_wstunnel but with no luck due to
> > > > > 1) I might compile something to very stable (Segmentation fault
> under
> > > > > Ubuntu 13.10 HTTP 2.4.6)
> > > > > 2) both main app and ws URL are looks the same:
> > > > > http://localhost/openmeetings and ws://localhost/openmeetings.
> > > > >
> > > > > Should I create additional page/mapping for performing ws
> tunneling?
> > > > > Maybe anyone can share example config/how to?
> > > > >
> > > > > Thanks in advance :)
> > > > >
> > > > > --
> > > > > WBR
> > > > > Maxim aka solomax
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > WBR
> > > Maxim aka solomax
> > >
> >
>
>
>
> --
> WBR
> Maxim aka solomax
>