 
     constructor: ->
         @app = express()
-        @proxy = new httpProxy.RoutingProxy()
+        @server = httpProxy.createServer @app
+        @proxy = @server.proxy
         @proxy.source.port = 9104
         @userManager = new UserManager()
         @instanceManager = new InstanceManager()

    # Start proxy server listening.
    start: (port) ->
        @proxyPort = port if port
        @server = @app.listen(process.env.PORT || @proxyPort)

    # Stop proxy server listening.
    stop: ->

            console.error err.stack
            res.send 500, 'Something broke!'

        @enableSocketRedirection()
        @setControllers()

    setControllers: ->
