Red5 / red5-websocket

Websocket plug-in for Red5
Apache License 2.0
61 stars 50 forks source link

Update usage docs or weird stuf #6

Closed iongion closed 5 years ago

iongion commented 6 years ago

Hi,

I am using red5 1.9.0-RELEASE and I was following the tutorial, in my Application class, I have added:

    private void enableWebsocketSupport(IScope scope) {
        WebSocketScopeManager manager = ((WebSocketPlugin) PluginRegistry.getPlugin("WebSocketPlugin")).getManager(scope);
        manager.setApplication(scope);
    }

    private void disableWebsocketSupport(IScope scope) {
        WebSocketScopeManager manager = ((WebSocketPlugin) PluginRegistry.getPlugin("WebSocketPlugin")).getManager(scope);
        manager.setApplication(scope);
    }

But in the docs it is manager.setApplication(this); but this is an ApplicationAdapter, while setApplication expects a IScope

mondain commented 6 years ago

Grab the application scope and pass it to the WS scope manager.

mondain commented 5 years ago

The websocket plugin is being refactored and moved into the tomcat plugin, but to answer your question with more detail, you'd use (inside the Application class) this.scope.