In Niostreamer version 0.3.0 we implemented a new useful feature called "Variables".

Now you can define a couple of values that can be re-used across you streaming instance settings.

How it looks like

There are two kinds of variables: user variables and system (or protected) vars.

User variables are defined using web control panel.

System variables are defined on the machine where Niostreamer installed. They are availably only to this instance locally, the values are not transferred to control panel.

Variables are located under "Variables" section of the corresponding instance:
chrome_TtrNQ2gDDS

On the above screen we can see that my.user.variable is a regular variable that has value and defined through control panel by user.

The ssl.default.certificate_file and ssl.default.certificate_key_file are defined on a Niostreamer side. They are located in /etc/niostreamer.conf (or whatever path where the config is located). The config in that case looks like:

server {
    ...

    vars {
        ssl {
            default {
                certificate_file = "/etc/ssl/niostreamer/ssl/cert.crt";
                certificate_key_file = "/etc/ssl/niostreamer/ssl/cert.key";
                certificate_password = "";
            }
        }
    }
}

System variables can be defined using hierarchy or in flat mode. The above example is equals to the following one:

server {
    ...

    vars {
      ssl.default.certificate_file = "/etc/ssl/niostreamer/ssl/cert.crt";
      ssl.default.certificate_key_file = "/etc/ssl/niostreamer/ssl/cert.key";
      ssl.default.certificate_password = "";
    }
}

Why do we need this?

The common idea is simple: good expirience and security. System variables are not available on a web control panel side, their values are not pushed by niostreamer instance to control panel at all, only the names are.

So, when you need to hide some secret points like password from SSL certificate when you setup a SSL network listener you can always use placeholders in favor of actual values.

To use variables in control panel you can type "{{ " (brace brace space) and select the coresponding var from popup list of suggestions:

chrome_TKTiveUgXw

User variables values will be resolved when sending settings to niostreamer, and System variables will be sent as placeholders and will be resolved on Niostreamer instance side.

In next posts we will talk about SSL SNI feature where it would be useful.

Enjoy!