Answer the question
In order to leave comments, you need to log in
How to adapt a module from Node.js to run in a browser in BitTorrent Sync?
Purpose:
Control running BitTorrent Sync from a browser. To do this, you need to adapt the library written for Node.js.
Task:
1. Take the ready-made node-bittorrent-sync library: https://github.com/yannickcr/node-bittorrent-sync/...
2. Adapt its execution in the IE browser. Can be done using jQuery.
Documentation:
BitTorrent Sync API: www.bittorrent.com/intl/ru/sync/developers/api
Why do we need BitTorrent Sync: habrahabr.ru/post/201072
Who can help with this task?
Instructions that may be helpful
To run Bittorent Sync with the API enabled, you need to:
1. Install Bittorent Sync itself
2. In the folder next to the exe file, create cmd: BTSync.exe /config "C:\Program Files (x86)\BitTorrent Sync\config.txt"
3. And next to create config.txt:
{
// path to folder where Sync will store its internal data,
// folder must exist on disk
//"storage_path" : "C:\Program Files (x86)\BitTorrent Sync",
// run Sync in GUI-less mode
"use_gui" : false,
"webui" : {
// IP address and port to access HTTP API
"listen" : "127.0.0.1:8888",
// login and password for HTTP basic authentication
// authentication is optional, but it's recommended to use some
// secret values unique for each Sync installation
"login" : "api",
"password" : "secret",
// Это мой ключ, который я получил от Bittorent
"api_key" : "63OPLBB3ZFSLX4LYQYY7ITXGJGS4ICKIRDYVN6ZKEP7XNQGRK7MM7VC3Z2BDIJBWP7UFXEHOJEPWTAUQQTPH7JZGPVG5WAQYPO75EDJ6USHCEQ2A4GWHGKTOULJMZEDBIYAAF7Y"
}
}
nock('http://localhost:8888')
.get('/api?method=get_os');
btsync.getOs(function(err, result) {
console.log(result);
});
nock.cleanAll();
Answer the question
In order to leave comments, you need to log in
Of course, you did a great job and wrote a lot of things, but you forgot the most important thing, JAVASCRIPT IN THE BROWSER DOES NOT WORK WITH FILES .
And you need to do the following, throw out all this what you wrote above. Take that library for node.js and write rest api or rpc api or whatever. Screw a simple interface on this and knock from this interface in this api, and there the node will already do what you need.
Here's a quick sketch: jQuery Bittorent Sync .
If Bittorrent Sync is configured , then you can go here , here is a small demonstration of work.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question