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.
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"
},
Parameter name | Parameter type | Required | Default | Description |
---|---|---|---|---|
gatewayList | Array of Objects | yes | - | 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). |
groupName | string | yes | - | A common name for a group of streams. |
Parameter name | Parameter type | Required | Default | Description |
---|---|---|---|---|
host | string | yes | - | A hostname of a Storm Server instance with enabled gateway functionality. |
application | string | yes | - | 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. |
port | number | no | 80 for non-ssl and 443 for ssl | To avoid issues with network firewalls, please use 80 for non-ssl connections and 443 for ssl connections. |
ssl | boolean | no | true | Whether SSL connection should be used or not. |
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.