与Web套接字的对等文件共享 [英] Peer-to-peer file sharing with Web Sockets

查看:159
本文介绍了与Web套接字的对等文件共享的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个理论问题,但是,我需要添加文件共享功能,以我的网络套接字动力聊天应用程序。我可以用像亚马逊S3服务上传文件张贴链接到文件分享,而是涉及一个文件的上传可能已经通过本地网络访问(共享同事之间例如文件) 。

所以我有这样的想法,可能通过已有的web套接字连接隧道上传/下载/传输。但是,我对HTTP文件传输知之甚少,不知道下一步如何实现它。是否有一个限制,以防止这可能的网络套接字?



我使用Ruby和EventMachine为我当前的网络套接字实现。如果你能提供一个高度概括让我开始,这将是非常赞赏。


解决方案

要允许文件无需将其上传到服务器(即同事),您现在可以使用WebRTC DataChannel API来创建点对点连接。


This is sort of a theoretical question, however, I need to add file sharing capabilities to my web socket powered chat application. I could use a service like Amazon S3 to upload a file to share by posting a link to the file, but that involves the uploading of a file that may already be accessible over the local network (sharing a file between co-workers for example).

So I had the idea that it might be possible to somehow tunnel the upload/download/transfer through the already existing web socket connection. However, I don't know enough about HTTP file transfer to know the next step of how to implement it. Is there a limitation to web sockets that would prevent this from being possible?

I'm using Ruby and EventMachine for my current web socket implementation. If you were able to provide a high level overview to get me started, that would be very much appreciated.

解决方案

To allow files to be shared without the need to upload it to the server, (i.e Coworkers) you can now use the WebRTC DataChannel API, to create a peer to peer connection.

这篇关于与Web套接字的对等文件共享的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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