Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] examples of WebSockets with CometD 2.9.1 and Jetty 9.2.1?


On Wed, Jul 9, 2014 at 11:34 AM, Michele Rossi <michele.rossi@xxxxxxxxx> wrote:
> hi,
> I am trying to set up my CometD server running on Jetty 9.2.1 to support the
> WebSockets transport.
> I  found a few bits and pieces online about configuring jetty to enable
> org.eclipse.jetty.websocket.jsr356 and in code I tried calling
> WebSocketServerContainerInitializer.configureContext( sctxHd ) but I have
> had no luck so far.
> I am interested in finding out how to do it in both code and using the .xml
> configuration files for my final distribution.
> Do you know of any straightforward examples that I could follow?

Distribution wise, there is not much you should do, apart enable the
http, websocket and deploy (to deploy from $JETTY_BASE/webapps)

$ mkdir jetty-cometd
$ cd jetty-cometd
$ java -jar $JAVA_HOME/start.jar --add-to-start=http,websocket,deploy
$ cp /whereever/cometd-demo-3.0.0.war webapps/
$ java -jar $JAVA_HOME/start.jar

You can find a simple example of how to setup the same in code here:

Simone Bordet
Developer advice, training, services and support
from the Jetty & CometD experts.
Intalio, the modern way to build business applications.

Back to the top