Re: [Resin-interest] Websockets - difference when using mod_caucho?

2015-04-07 Thread c.whalley
On 06/04/2015 19:14, Scott Ferguson wrote:
> On 4/5/15 5:23 AM, c.whalley wrote:
>> On 02/04/2015 16:28, c.whalley wrote:
>>> I've got pretty much the example from:
>>> http://wiki4.caucho.com/Resin_4_Java_EE_Basic_Servlet,_Comet,_and_WebSocket_Tutorial#Hello.2C_World_WebSocket_in_Resin
>> 
>> I've just proven this is caused by the mod_caucho config by tweaking the
>> setup so it uses port 8080 throughout, i.e. with the same deployed app
>> but "pure" resin we're good to go.
>> I've seen there is an apache mod_proxy_wstunnel which can upgrade the
>> incoming connection to a websocket connection but so far still haven't
>> been able to get this going, in any case why is this needed? I thought
>> all incoming traffic on port 80 was forwarded to 8080 once a virtual
>> server had the appropriate entries to do so for the servets etc in its
>> config?
> Because HTTP and websockets are very different, a HTTP proxy isn't
> powerful enough to tunnel websockets messages. Basically, a websocket
> proxy needs two threads, one to listen for server messages and a second
> thread to listen for client messages. But HTTP only needs a single
> thread to listen for server messages, because once the client POST is
> done, there are no more messages for HTTP.
>
> mod_caucho is designed around HTTP only (and Apache itself was designed
> around HTTP only).
>
> -- Scott
Hi Scott,

Thanks - I'd pretty much figured out now that you need to hit resin 
directly for this, thanks for the confirmation.

-- Carl
>>> This runs fine in my local env with resin on 8080 and Apache on 80
>>> (Win), same config on a Fedora 21 QA server but when deployed to
>>> production, which uses mod_caucho, I see
>>>
>> ___
>> resin-interest mailing list
>> resin-interest@caucho.com
>> http://maillist.caucho.com/mailman/listinfo/resin-interest
>>
>
> ___
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest
>


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Websockets - difference when using mod_caucho?

2015-04-06 Thread Scott Ferguson
On 4/5/15 5:23 AM, c.whalley wrote:
> On 02/04/2015 16:28, c.whalley wrote:
>> I've got pretty much the example from:
>> http://wiki4.caucho.com/Resin_4_Java_EE_Basic_Servlet,_Comet,_and_WebSocket_Tutorial#Hello.2C_World_WebSocket_in_Resin
> 
> I've just proven this is caused by the mod_caucho config by tweaking the
> setup so it uses port 8080 throughout, i.e. with the same deployed app
> but "pure" resin we're good to go.
> I've seen there is an apache mod_proxy_wstunnel which can upgrade the
> incoming connection to a websocket connection but so far still haven't
> been able to get this going, in any case why is this needed? I thought
> all incoming traffic on port 80 was forwarded to 8080 once a virtual
> server had the appropriate entries to do so for the servets etc in its
> config?

Because HTTP and websockets are very different, a HTTP proxy isn't 
powerful enough to tunnel websockets messages. Basically, a websocket 
proxy needs two threads, one to listen for server messages and a second 
thread to listen for client messages. But HTTP only needs a single 
thread to listen for server messages, because once the client POST is 
done, there are no more messages for HTTP.

mod_caucho is designed around HTTP only (and Apache itself was designed 
around HTTP only).

-- Scott

>
>> This runs fine in my local env with resin on 8080 and Apache on 80
>> (Win), same config on a Fedora 21 QA server but when deployed to
>> production, which uses mod_caucho, I see
>>
>
> ___
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest
>


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Websockets - difference when using mod_caucho?

2015-04-05 Thread c.whalley
On 02/04/2015 16:28, c.whalley wrote:
> I've got pretty much the example from:
> http://wiki4.caucho.com/Resin_4_Java_EE_Basic_Servlet,_Comet,_and_WebSocket_Tutorial#Hello.2C_World_WebSocket_in_Resin

I've just proven this is caused by the mod_caucho config by tweaking the 
setup so it uses port 8080 throughout, i.e. with the same deployed app 
but "pure" resin we're good to go.
I've seen there is an apache mod_proxy_wstunnel which can upgrade the 
incoming connection to a websocket connection but so far still haven't 
been able to get this going, in any case why is this needed? I thought 
all incoming traffic on port 80 was forwarded to 8080 once a virtual 
server had the appropriate entries to do so for the servets etc in its 
config?

> This runs fine in my local env with resin on 8080 and Apache on 80
> (Win), same config on a Fedora 21 QA server but when deployed to
> production, which uses mod_caucho, I see
>


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


[Resin-interest] Websockets - difference when using mod_caucho?

2015-04-02 Thread c.whalley
I've got pretty much the example from: 
http://wiki4.caucho.com/Resin_4_Java_EE_Basic_Servlet,_Comet,_and_WebSocket_Tutorial#Hello.2C_World_WebSocket_in_Resin

This runs fine in my local env with resin on 8080 and Apache on 80 
(Win), same config on a Fedora 21 QA server but when deployed to 
production, which uses mod_caucho, I see

[02-04-15 16:16:46.897] 35 ErrorPageManager sendServletErrorImpl 
java.lang.UnsupportedOperationException: com.caucho.server.hmux.HmuxRequest
 at 
com.caucho.server.http.AbstractHttpRequest.startDuplex(AbstractHttpRequest.java:1717)
 at 
com.caucho.server.http.HttpServletRequestImpl.startWebSocket(HttpServletRequestImpl.java:1646)
 at 
com.foo.WebSocketServlet.service(WebSocketServlet.java:55)
 at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:97)
 at 
com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:109)
 at 
com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:156)
 at 
com.caucho.server.webapp.AccessLogFilterChain.doFilter(AccessLogFilterChain.java:95)
 at 
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:289)
 at 
com.caucho.server.hmux.HmuxRequest.handleInvocation(HmuxRequest.java:476)
 at 
com.caucho.server.hmux.HmuxRequest.handleRequestImpl(HmuxRequest.java:374)
 at 
com.caucho.server.hmux.HmuxRequest.handleRequest(HmuxRequest.java:341)
 at 
com.caucho.network.listen.TcpSocketLink.dispatchRequest(TcpSocketLink.java:1349)
 at 
com.caucho.network.listen.TcpSocketLink.handleRequest(TcpSocketLink.java:1305)
 at 
com.caucho.network.listen.TcpSocketLink.handleRequestsImpl(TcpSocketLink.java:1289)
 at 
com.caucho.network.listen.TcpSocketLink.handleRequests(TcpSocketLink.java:1197)
 at 
com.caucho.network.listen.TcpSocketLink.handleAcceptTaskImpl(TcpSocketLink.java:993)
 at 
com.caucho.network.listen.ConnectionTask.runThread(ConnectionTask.java:117)
 at 
com.caucho.network.listen.ConnectionTask.run(ConnectionTask.java:93)
 at 
com.caucho.network.listen.SocketLinkThreadLauncher.handleTasks(SocketLinkThreadLauncher.java:169)
 at 
com.caucho.network.listen.TcpSocketAcceptThread.run(TcpSocketAcceptThread.java:61)
 at 
com.caucho.env.thread2.ResinThread2.runTasks(ResinThread2.java:173)
 at 
com.caucho.env.thread2.ResinThread2.run(ResinThread2.java:118)

The line in my code which causes this is wsReq.startWebSocket(listener); 
again from that example. It's not kidding either ;-) The code it hits 
from AbstractHttpRequest is:

public SocketLinkDuplexController startDuplex(SocketLinkDuplexListener 
handler)
{
   throw new UnsupportedOperationException(getClass().getName());
}

Now I know there are a few references to "(The WebSocketServletRequest 
API is temporary until the next Servlet specification integrates the 
startWebSocket method directly.)", but what could cause this to fail on 
the mod_caucho installation? Or am I looking in the wrong place?

___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest