backend-rustreamer
v0.0.2
Published
**backend-rustreamer**
Downloads
9
Readme
backend-rustreamer
Node-Part of Ruflix project. It contains:
- Proxy server for http://rutracker.org and http://api.rutracker.org
- Reader of http://feed.rutracker.org
- WebTorrent part, provides methods to download and stream torrents
In future:
- File managment of streamed torrents
- Database, shared with ui
- Socket.io based communication with webtorrent and file manager
- I2P Proxy with hidden rutracker.org service
It's taking args, which will extend local config.json:
config.hostFront - boolean, if server will host static directory with html app. Default: true.
config.frontDir - string, directory of front to host. Default: node_modules/ui-rustreamer, which is devDependency.
config.port - int, determines port of host, Defaults: 7000
config.ApiEndpoint - string, URL of Rutracker API. Default: http://api.rutracker.org:80
config.FeedEndpoint - string, URL of Rutracker Feed. Default: http://feed.rutracker.org/atom/f/1880.atom
Methods
'GET /rutrackerapi' - will be proxied to config.RutrackerApiEndpoint
'GET /feed' - will request RSS Feed from config.RutrackerFeedEndpoint.
Returns array of articles from feed.
'POST /login' (String username, String password) - will login the user
Returns {logged: boolean} if user is successfully logged
'GET /checklogin' - get authorization status
Returns {logged: boolean, username: ?string} if user is logged
'POST /search' - (Only if logged) provides search of rutracker.org resource
Returns Array<{ state : string, id : string, category : string, title : string, author : string, size : string, seeds : string, leechs : string, url : string }> with search results
'GET /torrentapi/add/:hash' - downloads the torrent and creates stream
Returns { files: Array<{ name: string - file name, length: int - file size, done: boolean - if 100% of file is downloaded, mime: string - mime-type of file }> with files to stream, stream: Array<{ address: string - host of stream, port: int - port of stream }> - streaming