Start jWebSocket Server as a Web App

This Chapter describes how to integrate the jWebSocket Server into existing web applications, e.g. in Tomcat environments. This topic will be interesting for you when you intend to run the jWebSocket Server on production systems either embedded within an existing web application or as a separate stand-alone web application.

Prerequisites

For Tomcat web applications the jWebSocket Server is provided in two jars, jWebSocketServer-Bundle-<version>.jar and jWebSocketTomcatEngine-<version>.jar files. It contains all the core jWebSocket classes, libraries, plug-ins and filters. You can get this file from the bundles section in the download area.

Please ensure that you have Tomcat 7.0.35+ and Java 1.6+ on your system. We recommend to either configure Tomcat to listen on port 80 or to use the Apache http server as front end together with mod_proxyy or mod_jk as bridge to Tomcat. Finally put the jWebSocketServer-Bundle-<version>.jar and the jWebSocketTomcatEngine-<version>.jar files into Tomcat's lib folder to make it available for your web application.

Running jWebSocket Server as Tomcat Web Application

In the download section you will find two ready-to-deploy web applications as .war files which have been tested for Tomcat 7.0.35+. Both applications are similar the difference is that one has been created using Maven.

  1. Get the jWebSocketAppSrvDemo-<version>.war or jWebSocketWebAppDemo-<version>.war
  2. Start Tomcat, open the Tomcat Manager at http://localhost:<port> in your browser and login with your admin credentials
    (please adjust host and port according to your environment).
  3. Deploy the .war file in Tomcat as follows:
WAR app deployment in Tomcat


 

 

Creating or extending Tomcat web apps

To create or extend new web apps using Tomcat and jWebSocket see details here.

Publications

Learn more about WebSockets in general, get background information and gain deeper insight!

Join jWebSocket

Wether developer, designer or translator – join the jWebSocket team and grow together with our success!

Copyright © 2013 Innotrade GmbH. All rights reserved.