Whats new:
- Search & stream torrents - preview
- Stream any file from the torrent - preview
- Monitor activity - preview
HTTP server to convert any torrent to video stream
npm install -g torrent-stream-server
torrent-stream-server serve
- Go to http://127.0.0.1:3000
One-click ready-to-code development environments:
Frontend & backend are separate packages.
So during developemnt you will need to run two dev servers with live reload:
npm run dev-backend
- start dev server on3000
portnpm run dev-frontend
- start dev server on3001
port
npm install
- will install both: frontend & backendnpm run build
- will build backend tolib
directory & frontend tofrontend/build
npm run start
- start HTTP server with frontend supportnpm run dev-backend
- startbackend
server with live reload on3000
portnpm run dev-frontend
- startfrontend
server with live reload on3001
port
Check bellow for descriptions
PORT
HOST
TRUST_PROXY
Configuration file can overwrite ENV variables
You can pass JSON config file to any run command (e.g. npm run start config.json
)
Available parameters:
- host - server host. Default is
process.env.HOST
or0.0.0.0
- port - server port. Default
process.env.PORT
or 3000. - trustProxy - get ip from
X-Forwarded-*
header, check more, Default istrue
if running inside App Engine or Heroku elsefalse
- logging
- level - debug, info, warn or error. Default info.
- transports -
{"type": "console"}
or{"type": "loggly","subdomain": "my-subdomain","token": "abc","tags":["my-tag"]}
. Defaultconsole
.
- torrents
- path - torrents storage path. Default
/tmp/torrent-stream-server
. - autocleanInternal - how many seconds downloaded from last stream torrent is kept before deleting. Default is 1 hour.
- path - torrents storage path. Default
- security
- streamApi - API is disabled when using this option unless
apiKey
is set.- key - JWT token.
- maxAge - the maximum allowed age for tokens to still be valid.
- frontendEnabled - enable demo page. Default is
true
. - apiKey - key which should be passed to headers to access the API (
authorization: bearer ${apiKey}
).
- streamApi - API is disabled when using this option unless
API uses swagger.yaml to:
- To generate API documentation page, which can be accesed when using
npm run dev
on http://127.0.0.1:3000/api-docs. - To generate frontend client (
frontend/src/helpers/client
) - To generate backend models (
src/models
)
Running the following command from a shell will run VLC and start playing the Sintel movie stream from its public torrent:
$ vlc "http://localhost:3000/stream?torrent=magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel&file=Sintel.mp4"
You can protect stream API with JWT token.
{
"secury": {
"streamApi": {
"key": "secret key",
"maxAge": "5h"
}
}
}
{
"alg": "HS256",
"typ": "JWT"
}
{
"iat": 1554577257,
"torrent": "magnet:?xt=urn:btih:4GOZACR2HENLSNHA7K6GSOFSTDWGOENJ&tr=http://nyaa.tracker.wf:7777/announce&tr=udp://tracker.coppersurfer.tk:6969/announce&tr=udp://tracker.internetwarriors.net:1337/announce&tr=udp://tracker.leechersparadise.org:6969/announce&tr=udp://tracker.opentrackr.org:1337/announce&tr=udp://open.stealth.si:80/announce&tr=udp://p4p.arenabg.com:1337/announce&tr=udp://mgtracker.org:6969/announce&tr=udp://tracker.tiny-vps.com:6969/announce&tr=udp://peerfect.org:6969/announce&tr=http://share.camoe.cn:8080/announce&tr=http://t.nyaatracker.com:80/announce&tr=https://open.kickasstracker.com:443/announce"
}
iat
- unix timestamp, which indicates when was the key generatedtorrent
- torrent magent link
HMACSHA256(
base64UrlEncode(header) + "." +
base64UrlEncode(payload),
"ENTER KEY HERE"
)