EnglishEnglish RussianРусский SpanishEspañol

HLS-Proxy is a server app for IPTV streaming in HLS format (Apple HTTP Live Streaming) and caching for IPTV-player without dropouts and buffering.

HLS-Proxy setup Video guide on YouTube

  • Unpack an archive with proxy to a folder.
  • Now you need to configure http port for listening.

    By default, HLS-Proxy uses HTTP port 80.
    You can change it by passing a command line parameter -port port_number.
    Example:

    ./hls-proxy -port 8080

    To save it permanently add -save

    ./hls-proxy -port 8080 -save

    To get all supported CLI parameters:

    ./hls-proxy -help

  • If you are a Linux user:
    • Install using a script:

      ./install.sh

      An install script uses systemctl to run HLS-Proxy as a service at boot.
      If you under chroot: a script will not work. Add a next line to /etc/rc.local

      sudo -H -u <user> <hls-proxy path>/hls-proxy &

      Where:
      <user>: user you logged in
      <hls-proxy path>: a directory where HLS-Proxy unpacked

      Important!!! Ubuntu 16 users may not use http port 80.

    • Or you can run HLS-Proxy manually.
      Do not forget to add executable permissions for a file hls-proxy:

      chmod 755 ./hls-proxy

  • After app start, you can open next links for tuning a proxy:

    • http://hls_proxy_ip/ - For IPTV-player it is a link to a m3u8 playlist. For a browser it is a html rich page with channels and EPG.
      You also can access a rich web UI by /channels
    • http://hls_proxy_ip/status - A proxy status page, opened streams and clients.
    • http://hls_proxy_ip/config - A config view and edit page. Changes will be stored to local.json file, which contains parameters different from default.json
    • http://hls_proxy_ip/epg (or /epg.xml.gz) - EPG link for your IPTV-players in xml.gz format
      Second one in brackets is configurable from config by variable epgUrlForClient
      Uncompressed EPG is available by the same links just without .gz
    • http://hls_proxy_ip/m3u8 (or /playlist.m3u8)- If the root link (/) is not opened in a player you can use this link as a playlist. Perfect Player for Windows doesn't work.
      Second one in brackets is configurable from config by variable playlistPath
    • http://hls_proxy_ip/rec (or /recordings.m3u8) - Recorded programs.

    Instead of hls_proxy_ip use any local computer address or hostname where hls-proxy runs

    If you get an error on start "Cant start server: listen EADDRINUSE: address already in use"

    then a http port you specified (or 80 by default) is used by another app. Change it by command line.

    Proxy will be available by link http://hls_proxy_ip:port/
    To keep it permanently - open http://hls_proxy_ip:port/config and click "Save"
    or you can specify a command line parameter -save

Playlist setup

The most important thing to setup is a playlist source.
If HLS-Proxy is running, open /config, find "URL" field in "Playlist" section and put there your playlist link. Press "Save" button to apply changes.
Wait a couple of seconds till a playlist is loading and that's it.
By opening a main page / you should see a channels list.

Config catch ups

Proxy stores its settings in JSON files.
The main config file - default.json. It is not recommended to edit it manually. Editing config using web config saves changes into additional local.json file.
Inside local.json stored values different from defaults.
Self-Update will replace hls-proxy executable and default.json

Other.

Detailed description of settings you can find at web page /config

EPG is not available at the start. It will take minutes to download and parse. Watch a status at web page /status

Admin password and user management (new).

By default HLS-Proxy is not protected by admin password. This feature is available from version 6.
In order to set an admin password and protect a content you need to open /config web page and put a password in first SERVER section.
Save config and reload it from the /status page.
Now you should see a login page. Enter "admin" as a username and a password to gain an access.

A logged in user has an access to the all pages as before.
To enable an access from devices you need to add users and make a pairing. Scroll down to the "clients" section and add a user with a password.
You can put to the client a full playlist url. You can copy it to clipboard and paste on device.
The second option is a link with a pass code. A code is 6 digits that you need to add to HLS-Proxy main URL in the web browser of your device.
It will open a window with a full playlist URL with an availability to copy it to the device clipboard.
From v8.4.5 a playlist can be downloaded by username/password. Just add ?username=[username]&password=[password] instead of user token into the link.

MPEG-TS output format for a client

Add output=ts as query parameter to the playlist or channel URL

Example:

http://localhost/?output=ts

VOD using HLS-Proxy

Convert video using ffmpeg:

ffmpeg -i input.mkv -start_number 0 -hls_time 10 -hls_list_size 0 -hls_flags single_file -c copy -hls_segment_type mpegts -hls_allow_cache 0 index.m3u8

index.m3u8 and index.ts put in the folder along the path

HLS-PROXY-DIR/recordings/VOD/VIDEO

Enter the playlist address in the player:

http://hls-proxy-address/rec

New video on the way

/recordings/VOD/VIDEO1

VOD - will be the name of the group in the playlist

VIDEO - will be the name of the stream

Folders inside recordings can have any name

Works since 8.0.0

HTTP proxy setup

Configure external HTTP proxy to bypass firewalls using environment variables

The following environment variables are respected by HLS Proxy

  • HTTP_PROXY / http_proxy
  • HTTPS_PROXY / https_proxy
  • NO_PROXY / no_proxy

When HTTP_PROXY / http_proxy are set, they will be used to proxy non-SSL requests that do not have an explicit proxy configuration option present. Similarly, HTTPS_PROXY / https_proxy will be respected for SSL requests that do not have an explicit proxy configuration option. It is valid to define a proxy in one of the environment variables, but then override it for a specific request, using the proxy configuration option. Furthermore, the proxy configuration option can be explicitly set to false / null to opt out of proxying altogether for that request.

HLS Proxy is also aware of the NO_PROXY/no_proxy environment variables. These variables provide a granular way to opt out of proxying, on a per-host basis. It should contain a comma separated list of hosts to opt out of proxying. It is also possible to opt of proxying when a particular destination port is used. Finally, the variable may be set to * to opt out of the implicit proxy configuration of the other environment variables.

Here's some examples of valid no_proxy values:

  • google.com - don't proxy HTTP/HTTPS requests to Google.
  • google.com:443 - don't proxy HTTPS requests to Google, but do proxy HTTP requests to Google.
  • google.com:443, yahoo.com:80 - don't proxy HTTPS requests to Google, and don't proxy HTTP requests to Yahoo!
  • * - ignore https_proxy/http_proxy environment variables altogether.