hlx-http-put
v0.0.6
Published
A writable stream to send HLS streams to an external HTTP/HTTPS server
Downloads
9
Readme
hlx-http-put
A writable stream to send HLS streams to an external HTTP/HTTPS server
Features
- Being used with other
hlx
objects, it provides a functionality to send every HLS related files (playlist and segments) to an external HTTP/HTTPS endpoint.
Install
Usage
const hlx = require('hlx');
const {createWriteStream} = require('hlx-http-put');
const writable = createWriteStream({
endpoint: 'http://foo.bar/input'
});
// Send files to the remote endpoint
hlx.src('http://example.com/master.m3u8')
.pipe(decryptor)
.pipe(hlx.dest(writable))
.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 |
| ----------- | ------ | ------- | --------------------------------- |
| endpoint | string | N/A | URL of the destination (webdav server endpoint) |
| rootPath | string | The path included in url
| Will be used when the playlist contains relative urls |
| agent | http.Agent | undefined | Proxy agent |
return value
An instance of TransformStream
.