             console.error err.stack
             res.send 500, 'Something broke!'
 
+        @enableSocketRedirection()
         @setControllers()
 
     setControllers: ->


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

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

    # Stop proxy server listening.
    stop: ->
