Gateway configuration - Storm JavaScript Library

The gateway method is an alternative to the Embedded configuration and does not require embedding stream data within the config object. Instead, a template containing all stream data (including alternative server list, multiple quality/sources, quality labels etc.) is pushed to the origin server and automatically copied to all edge servers.

Thanks to this approach, there is no need to set all stream data for every scenario manually. It is also possible to use inbuilt load-balancing functionality since servers themselves will know which one is under the lowest load or stopped working due to a malfunction.

Before you can use this method, you have to configure Cluster & load balancing feature. A more detailed description of how to set up the gateway functionality is described in Gateway server section.

Sample javascript configuration

                        
connectionType:"gateway",
stream: {
    gatewayList: [
        { host: "sub1.yourdomain.com", application:"live", port: 443, ssl: true},
        { host: "sub2.yourdomain.com", application:"live", port: 443, ssl: true}
    ],
    groupName: "test"
},
                    

stream parameters

Parameter nameParameter typeRequiredDefaultDescription
gatewayListArray of Objectsyes-List of available gateway servers. The library will pick the first one from top and try to connect. If a connection with a server cannot be establish, another server from the list is taken as backup (and so on).
groupNamestringyes-A common name for a group of streams.
Table 1. gatewayList item

gatewayList item parameters

Parameter nameParameter typeRequiredDefaultDescription
hoststringyes-A hostname of a Storm Server instance with enabled gateway functionality.
applicationstringyes-The name of an application within a Storm Server instance. Applications are separate blocks of stream groups. A stream name must be unique within such a group, but you can create multiple applications.
portnumberno80 for non-ssl and 443 for sslTo avoid issues with network firewalls, please use 80 for non-ssl connections and 443 for ssl connections.
sslbooleannotrueWhether SSL connection should be used or not.
Table 2. gatewayList item

Adaptive Bitrate Streaming

In similar fashion to the Embedded configuration, the Gateway also enables an inbuilt mechanism for ultra-low latency adaptive bitrate streaming. This feature requires two or more sources with bitrate parameter added to streamInfo object registered under a single groupName. Whenever the library's algorithm detects an unstable viewer connection, it will automatically switch the stream to a lower quality. It will also try to increase the quality when the connection is stable again.

If two or more sources have exactly the same bitrate value - the library will treat them as backup sources.