4.15.0 • Published 6 years ago

enginefs v4.15.0

Weekly downloads
124
License
-
Repository
github
Last release
6 years ago

enginefs

Simple layer to use and manage torrent-stream engines and access them through HTTP / FUSE.

Somewhat similar to peerflix-server, but allows more sophisticated management, such as automatically closing torrent-stream's after some time of inactivity, etc.

Wishlist:

  • HLS support - allow live transcoding to HLS
  • FUSE support

Example:

var enginefs = require("enginefs");

// Set engine - standard torrent-stream would do the trick
enginefs.engine = require("torrent-stream");

// After 20s of inactivity we consider a HTTP stream to be inactive, and if an engine (infoHash) has had no active streams for 2 minutes we destroy it
enginefs.STREAM_TIMEOUT = 20*1000;
enginefs.ENGINE_TIMEOUT = 2*60*1000;

// Init the server, try different ports
var server = enginefs.http();
server.listen(10000);

server.on("listening", function() {
    enginefs.baseUrlLocal = "http://localhost:" + server.address().port;
    enginefs.baseUrl = "http://localhost:" + server.address().port;
    console.log("EngineFS server started at " + enginefs.baseUrl);
});

// You can use middlewares
enginefs.middleware(function(path, req, res, next) {
    console.log("-> "+req.url); // Logging purposes
    next();
});

// Init an engine when we request it
enginefs.on("request", function(hash) {
    enginefs.create(hash, {
        path: os.tmpdir() + '/' + hash,
        // put any torrent-stream parameters in here, like path
        peerSearch: { min: 40, max: 150, cooloff_time: 30, cooloff_requests: 15, sources: [ "dht:"+hash ] }
    })
});

// Stream Big Buck Bunny
// vlc http://localhost:10000/2f24d03eab998ca672b8c1ef567a184609236c02/0

// Stream Wizard Of Oz
// vlc http://localhost:10000/24c8802e2624e17d46cd555f364debd949f2c81e/0
4.15.0

6 years ago

4.14.1

6 years ago

4.13.6

7 years ago

4.12.3

7 years ago

4.12.2

7 years ago

4.12.1

7 years ago

4.12.0

7 years ago

4.11.1

7 years ago

4.11.0

7 years ago

4.10.1

7 years ago

4.9.2

8 years ago

4.9.1

8 years ago

4.9.0

8 years ago

4.8.6

8 years ago

4.8.5

8 years ago

4.8.4

8 years ago

4.8.2

8 years ago

4.8.1

8 years ago

4.8.0

8 years ago

4.6.0

8 years ago

4.5.0

8 years ago

4.4.0

8 years ago

4.3.1

8 years ago

4.3.0

8 years ago

4.2.0

8 years ago

4.0.0

8 years ago

3.2.1

8 years ago

3.2.0

8 years ago

3.1.2

8 years ago

3.1.1

8 years ago

3.1.0

8 years ago

3.0.5

8 years ago

3.0.4

8 years ago

2.1.4

8 years ago

3.0.3

8 years ago

3.0.2

8 years ago

2.1.3

8 years ago

3.0.1

8 years ago

2.1.2

8 years ago

2.0.6

8 years ago