hlx-webdav-push
v0.0.13
Published
A writable stream to send HLS streams to an external WebDAV server
Downloads
5
Readme
hlx-webdav-push
A writable stream to send HLS streams to an external WebDAV server
Features
- Being used with other
hlx
objects, it provides a functionality to send every HLS related data (playlist and segments) to an external webdav endpoint.
Install
Usage
const hlx = require('hlx');
const {createWriteStream} = require('hlx-webdav-push');
const webdav = createWriteStream({
url: 'http://foo.bar/webdav',
user: '{webdav user}',
pass: '{webdav password}'
});
// Send files to an external webdav endpoint
hlx.src('http://example.com/master.m3u8')
.pipe(decryptor)
.pipe(hlx.dest(webdav))
.on('error', err => {
console.log(err.stack);
});
API
The features are built on top of the Node's transform streams.
createWriteStream(options)
Creates a new TransformStream
object.
params
| Name | Type | Required | Default | Description | | ------- | ------ | -------- | ------- | ------------- | | options | object | Yes | N/A | See below |
options
| Name | Type | Default | Description |
| ----------- | ------ | ------- | --------------------------------- |
| url | string | N/A | URL of the destination (webdav server endpoint) |
| user | string | N/A | Basic auth user name |
| pass | string | N/A | Basic auth password for the server |
| digest | boolean | false | If true and user/pass are both specified, digest-based authentication will be enabled |
| token | object | N/A | An object holding Access Token parameters issued by OAuth 2.0 auth server. Client must specify either token
or user
/path
. token
is ignored when user
/pass
are present. |
| inputDir | string | / | The root directory from which all the files are read (This option is only used in case of file urls) |
| concurrency | number | 6 | Max number of requests concurrently sent |
| agent | http.Agent | undefined | Proxy agent |
return value
An instance of TransformStream
.