flash - Red5 安全教程

标签 flash red5 flash-media-server

我正在寻找有关保护 Red5 免受入侵的分步教程。这似乎是一个在谷歌搜索中经常出现的问题,但从来没有以对普通 Flash 开发人员有意义的方式得到真正的回答。

最佳答案

您可以使用安全框架保护 red5 用于发布、播放或共享对象。在这种情况下,客户端无关紧要,但如果您想保护 oflaDemo,例如,您需要在后端添加安全 Hook 。这是您需要的教程:
http://wiki.red5.org/wiki/Documentation/UsersReferenceManual/Red5CoreTechnologies/04-Security

更深入的安全教程在这里:
http://wiki.red5.org/wiki/Documentation/Tutorials/Red5AndAcegiSecurity

一个简单的阻止播放的例子如下:

public class PlaybackSecurity implements IStreamPlaybackSecurity {
    @Override
    public boolean isPlaybackAllowed(IScope scope, String name, int start, int length, boolean flushPlaylist) {
        //start out denied
        boolean allowed = false;
        //get the current connection
        IConnection conn = Red5.getConnectionLocal();
        //token to use for auth
        Long token = -1L;
        if (conn.hasAttribute("token")) {
            //get a 'token' we stored on their connection from elsewhere
            token = conn.getLongAttribute("token");
            //validate the token in some way
            if (token > 0L) {
                allowed = true;
            }
        }
        //return allowed or denied state
        return allowed;
    }
}
安全类应该在你的应用程序启动时添加,所以我建议你把它放在你的应用程序适配器的“appStart”方法中,如下所示:
    @Override
    public boolean appStart(final IScope app) {
        //register our stream security classes
    registerStreamPlaybackSecurity(new PlaybackSecurity(applicationContext));
        //pass control back to super
        return super.appStart(app);
    }

使用 Red5 的 CRAM 认证教程和来源:http://blog.infrared5.com/2012/05/red5-authentication/

关于flash - Red5 安全教程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1702729/

相关文章:

parsing - 如何从 swf 文件中提取源代码

Java:线程主java.lang.NoClassDefFoundError中的异常

java - 使用red5服务器实现桌面屏幕共享

apache-flex - 0.9 版本的任何 Red5 工作示例项目

flash - 将 adobe media server 视频直播到 HTML 5

Flash 媒体服务器 4.5 的 PHP 问题

php - 用户是否有一种简单的方法可以从浏览器打印 Flash(打开 Flash 图表)?

javascript - 从 javascript 或 ASP.Net 读取 Flash Cookie

java - Flash WebSockets 后备和 Jetty 8?

java - red5中的多线程