Peer-to-peer file sharing with web sockets

This is kind of a theoretical question, however, I need to add file sharing capabilities to my chat application with a web soker. I could use a service like Amazon S3 to upload a file for publication by posting a link to the file, but this is related to downloading a file that can already be accessed through the local network (for example, to share a file between colleagues).

So, I had the idea that it is possible to somehow tunnel download / upload / transfer through an existing connection to a web socket. However, I do not know enough about transferring an HTTP file to find out the next step, how to implement it. Is there a restriction on web sockets that would prevent this from being possible?

I am using Ruby and EventMachine for my current web socket implementation. If you could provide a high level review to get me started, that would be greatly appreciated.

0
ruby file-upload websocket eventmachine
Feb 15 2018-12-15T00:
source share
2 answers

To allow file sharing without having to upload to a server (e.g. Colleagues), you can now use the DataChannel WebRTC API to create a peer-to-peer connection.

0
Jan 08 '13 at 0:43
source share
— -

Here is an example project that uses only web sockets and the javascript File API to transfer files: http://www.github.com/thirtysixthspan/waterunderice

+1
Feb 20 '12 at 15:43
source share



All Articles