Luigi,

On 3/23/16 12:26 PM, Luigi Suardi wrote:
> I have a working websocket based application based on Tomcat 7.0.68 
> examples in my local environment. There are issues (i.e. 
> java.lang.UnsupportedOperationException: HTTP upgrade is not 
> supported by the AJP protocol) when running the same in a data
> center with an Apache web server front end that acts as a load
> balancer.

It's true: the AJP protocol does not support upgrading to other
protocols (e.g. websocket, HTTP/2).

> In this scenario, the Java hosting provider is asking me to run 
> websocket traffic through separate dedicated port XXXX. So I would 
> have to respond to regular HTTP requests over default 8080 port and 
> to HTTP websocket requests over port XXXX. Is it possible to still 
> use the annotated @ServerEndpoint or similar approach and tell it to 
> listen on the XXXX port? How can I do this under Tomcat?

You shouldn't need to do that: Tomcat will take care of the port
mappings; just write your application as usual without any port numbers.
If you have a client using a ws:// URL, they will connect through port
XXXX and the upgrade should succeed. I'm not exactly sure how the web
server will be configured to handle this, though. Or were you planning
to generate ws:// URLs with embedded port numbers?

-chris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to