the negation of negation blog posts work & projects about

Red5 and RESTEasy in 3 Steps

Red5 is a media streaming server which is implemented using Java and bundled in a Tomcat application container. Decoupling it from Tomcat is a bit troublesome. If you want to add a bit of HTTP REST flavour to your application without the hassle of decoupling it from Tomcat, you can use RESTEasy. Here is how I did it.

Red5 runs on Tomcat and is not really actively developed. I needed to add some lightweight HTTP API functionality to our Red5 application and decided to use RESTEasy which is a fully certified and portable implementation of the JAX-RS specification. It is also included in the latest Wildfly.

It was not that difficult:

  1. Download latest RESTEasy and unpack the lib/ folder contents into the lib/ folder of Red5 (or in other words, Tomcat).
  2. Add a JAX-RS annotated class and method, like:: package com.example.red5.application.api

    import java.util.HashMap;
    public class Version {
        public HashMap<String, String> responseMsg() {
            HashMap<String, String> result = new HashMap<String, String>();
            result.put("version", "0.0.1");
            return result;
  3. Add the following into your WebContent/WEB-INF/web.xml contents (place within the web-app tag): resteasy-servlet org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher


Now, you can deploy your application and restart the Red5 server. Hit http://localhost:5080/yourapp/api/version, and voila!...