Is it possible to create a torrent client using only HTML (5) and JavaScript?

There is not much to add. Is it possible to create a torrent client using only HTML and JavaScript. You cannot use things like Java, ActiveX, NaCl ... If so, give a high-level description.

I do not have much knowledge about the interface, but I think that web ports will be able to perform network interactions (is it possible to connect one client to another without having all the data through the server?). I know that you cannot write files using JavaScript, so I think that the downloaded file must either be completely stored in memory, or the client will have to use one of the new APIs in HTML5 to store the content.

+43
javascript html html5 websocket bittorrent
Jan 23 '11 at 19:58
source share
7 answers

In a recent version based on WebRTC that works in node and browser: https://github.com/feross/webtorrent

+15
Oct 28 '14 at 16:30
source share
— -

No. This is not true.

This is due to the fact that the WebSocket specification goes beyond HTML5 and JavaScript ;-) Speaking of this, opening the question "use functions supported initially in [progressive / future] browsers", then ...

... still not :-)

This is because installing with restrictions for WebSocket requires a special handshake. This is not a free open TCP festival. This approach will require either

  • clients must be modified to accept WebSocket requests (as well as to resolve any cross-site access issues)

  • or, more realistic, a bounce server

+32
Jan 23 '11 at 20:24
source share

This is possible using the Chrome APIs : chrome.socket and chrome.fileSystem .

There is at least one pure JavaScript implementation in Google Chrome: JSTorrent .

+16
Mar 02 '13 at 11:48 on
source share

There is no good reason why this cannot be done today. BitTorrent / uTorrent has code to support websocket connections with binary frames. However, they are currently compiled without support (due to political reasons for which I think). I worked at BitTorrent, and another engineer ( Arty ) wrote support. For some time it was really cool to download torrents on iPad from mobile Safari. (just save on Google Drive)

HTTP trackers can be configured to send Access-Control-Allow-Origin headers.

Also, the tracker announcement protocol can use a bit in the "key" field to indicate that the client is accepting web socket connections. Then a special argument of type "typewant" may indicate that the response of the advertisement should return only those clients who sent this bit.

The tracker protocol can also be expanded in the same way as negotiating support for WebCTC P2P DataChannel connections, so that connections can be made directly by the browser ↔ browser.

We currently have the chrome.socket and jstorrent platform APIs, a chrome package application (mainly for ChromeOS)

+9
Aug 21 '13 at 3:48 on
source share

You cannot use WebSockets because it is strictly a client server. But the upcoming WebRTC standard, mainly focused on audio and video conferencing, provides support for common data transfer client data. If this situation reaches the final version, then you will have a viable way to implement common peer-to-peer data transfers between browsers.

+8
Dec 09 '11 at 9:01
source share

I'm late to the party, but since this question is still among Google’s best results, I’ll answer anyway.

You can write BitTorrent-related web applications or browser extensions using Btapp.js , which uses the Javascript interface provided by BitTorrent Torque . When you call the connection method, the user will be prompted to install BitTorrent Torque, which is all. Some interesting things go on if you browse existing projects using streaming media, drag and drop sharing, etc.

As for solutions without any dependency, those that Nick Russell talked about still seem to be the only options.

+3
Jul 21 '13 at 9:30
source share



All Articles