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
You can pass env variables to configurate certain ares.
Check EnvVariables interface to see available ENV variables
You can pass JSON config file to any run command with -c
option (e.g. npm run start -c config.json
).
Check Config interface to see available configuration options
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/08ada5a7a6183aae1e09d831df6748d566095a10"
This command will download Sintel movie from torrents and save as sintel.mp4
.
curl "http://localhost:3000/stream/08ada5a7a6183aae1e09d831df6748d566095a10" > sintel.mp4
API can be protected with security.apiKey
, stream api can have additional JSON Web Token (configurable via security.streamApi.key
).
If only only one key specified in the config, it will be used as both: API key
& streamApi.key
.
When api or stream key is enabled, each API call will require Authorization
header:
Authorization: Bearer <token>
import { sign } from 'jsonwebtoken'
const url = `/stream/${encodeURIComponent(
sign(
{
torrent: '08ada5a7a6183aae1e09d831df6748d566095a10',
fileType: 'video',
},
key
)
)}`
This API will have encoded parameters, so it's safe to share it publicly. It will automatically expire (configurable via security.streamApi.maxAge
)