Fake a live/event HLS stream from a VOD one. Useful for testing.

Downloads in past


67150.1.13 years ago6 years agoMinified + gzip package size for mock-hls-server in KB


npm version
Mock HLS Server
Fake a live/event HLS stream from a VOD one. Useful for testing.
npm install -g mock-hls-server
to install globally.
will start the server running on "http://localhost:8080".
mock-hls-server -p 8000 --event
will start listening on all interfaces on port 8000. It will also serve the playlist as an EVENT playlist, which means URL's will never be removed from the start.
These are all the options:
  • host
  • port
  • windowSize: The number of seconds to keep in the playlist. Not valid with --event.
  • initialDuration: The number of seconds into the stream that should be available on the first playlist request.
  • event: Changes the playlist type to EVENT, meaning no segments will ever be removed.
  • loop: Loop the playlist.
  • logLevel

Now start your stream at http://localhost:8080/proxy?url=<stream url>. The first playlist request will start the stream. Variant playlists are supported, and the playlist URL's contained in them will be rewritten to route through the proxy.
The source stream should be a VOD playlist that contains all the segments.
and then start streaming 'http://localhost:8080/proxy?'