Flash10+p2p真的有用吗? [英] Does Flash10 + p2p really work?

查看:17
本文介绍了Flash10+p2p真的有用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在谷歌上搜索,但仍然无法找到.有人说:给你,就用吧.其他人声称它有某些限制,不允许您在 Flash 中以您希望的方式使用 p2p.

I've been googling around and I still can't get it. Some people say: here you go, just use it. Others claim it has certain restrictions that does not allow you to use p2p the way you want it in Flash.

那么,这里有一个简单的问题:是否可以实现一个 Flash10 应用程序,它使用一些现有的 torrent 文件将视频/音频直接传输到用户的浏览器中?

So, here's a simple question: is it possible to implement a Flash10 application, that uses some of the existing torrent files to stream video/audio right into the user's browser?

如果没有 - 为什么?这个不"有什么可能的解决方法吗?如果是 - 实施的困难是什么,为什么还没有人真正做到?

If no - why? Is there any possible workaround for this 'no'? If yes - what are the difficulties of the implementation and why have no one actually done it yet?

推荐答案

答案几乎是否定的......好吧,说实话,它只是没有.
@drudru 指出了适用于 flash p2p 的正确技术,即 Stratus.

The answer is pretty much no ... well, it's just no, to be honest.
@drudru pointed out the right technology for flash p2p, i.e. stratus.

Flash p2p 基于 RTMFP,它建立在 UDP 之上.实际上,flash 确实绑定了一个端口,但这来自内部.没有 API 可以手动执行此操作.

Flash p2p is based on RTMFP, which is built upon UDP. Actually, flash does bind a port, but this comes from the internals. There is no API to do that manually.

RTMFP 基本上允许两件事:

RTMFP basically allows two things:

  1. 用于视频和音频的 UDP 流(不可靠,但速度快).从 Flash 端,您只能发布您的相机和麦克风流.从服务器,几乎任何东西.
  2. 对 p2p 连接的另一个端点进行远程调用.这可用于传输数据.这种通信是安全的,即包顺序和完整性由 Flash 播放器维护.

p2p 基于 NAT 穿透.Stratus 本身就是介绍服务器.此外,出于安全目的,p2p 连接也意味着,两个客户端都必须有一个空闲的 TCP(如果我没记错的话)连接到服务器.我猜,当然传输了一些数据,但不是有效载荷.

The p2p is based on NAT punchthroughs. Stratus itself is the introduction server. Also, for security purpose, a p2p connection also means, both clients have to have an idling TCP (if I remember correctly) connection to the server. I guess, a bit of data is transmitted of course, but not the payload.

然而,torrent 协议与此有很大不同.因此,这不是一个选项.您可以在 RTMFP 之上构建等效的协议,对层服务进行逆向工程(或等到它开源).这当然也可以由非闪存客户端使用.但同样,您将无法将传输的数据作为视频观看,因为您将获得作为对 NetStream 客户端的某些调用的参数,可能是 ByteArray.并且您无法播放 ByteArrays.您可以编写非 Flash 客户端,将视频发布为流,但我猜这与您想要的相差甚远.

However, the torrent protocol is very different from this. Therefore, this is not an option. You could build an equivalent protocol on top of RTMFP, reverseengineering the stratus service (or wait until it's open sourced). This could of course also be used by non-flash clients. But again, you would not be able to watch the transmitted data as a video, since you will get is as a param to some call to the client of your NetStream, probably a ByteArray. And you cannot play back ByteArrays. You could write non flash clients, that publish videos as a stream, but that would be far from what you wanted, I guess.

如果你真的想做这样的事情,你需要Java.您可以签署 Java 小程序,如果用户接受证书,他们实际上可以不受限制地访问,例如你可以绑定端口.由于 Java 可以执行 UDP,因此您可以拥有一个 Java 小程序,它可以进行种子下载(也许只使用 Vuze 代码库),如果您真的想在 flash 中显示它(这又需要 flv),那么您可以模仿本地"Flash Media Server"并在 localhost:someport 上发布视频.但实际上,闪存位对我来说似乎非常复杂且无用.而是尝试使用 Java 播放,希望它可以选择在本机上这样做.

If you really want to do anything like that, you need Java. You can sign Java applets, and if user accepts the certificate, they have practically unrestricted access, e.g. you could bind ports. Since Java can do UDP, you could have a Java applet, that does the torrenting (maybe just use the Vuze codebase) and if you really want to display it in flash (which in turn requires flv), then you could mime a local "Flash Media Server" and publish the video on localhost:someport. But really, the flash bit seems ridiculously complicated and useless to me. Rather try playing back with Java, which hopefully has an option to do so natively.

这篇关于Flash10+p2p真的有用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆