VHosts Configuration - Storm Streaming Server

VHosts configuration directly relates to sockets and the protocols they support. A single instance of Storm Streaming Server can have multiple active sockets, each with an individually defined list of supported protocols (e.g., RTMP, HTTP). Each socket can operate in SSL mode, provided that the appropriate certificate file (jks) along with a password is supplied.

Sample Configuration

Below you’ll find default configuration:


<VHosts>
    <VHost host="127.0.0.1" port="1935" isSSL="false">
        <Protocols>RTMP</Protocols>
    </VHost>
    <VHost host="127.0.0.1" port="8080" isSSL="false">
        <Protocols>WEBSOCKETS, HTTP</Protocols>
    </VHost>
</VHosts>

For SSL enabled socket a VHOST item differs a bit:


<VHost host="127.0.0.1" port="443" isSSL="true">
    <Protocols>WEBSOCKETS, HTTP</Protocols>
    <Certificate path="/etc/ssl/private/wildcard.acme.com.jks" password="qwerty" />
</VHost>

Field Explanation

VHost:hostA host or an IP where socket should be opened. You can use “*” to open a socket on all network interfaces.

For Docker-based setups please always use “*”, because ports must be forwarded between a host and a container.
VHost:portTCP/IP port where should be opened.
VHost:isSSLSpecified whenever this virtual host should run though SSL Layer. Please keep in mind that if this field is set to “true” <Certificate> tag is required.
ProtocolsList of protocols supported on this virtual host. Available protocols: HTTP, WEBSOCKETS, RTMP.
Certificate:pathA path to jks certificate file.
Certificate:passwordA valid password for the jks file.
Table 1. Field explanation table

Available Protocols

RTMPThe most popular protocol for creating audio-video broadcasts is primarily used for delivering the stream to the streaming server. The default port for this protocol is 1935. Storm Streaming Server supports this protocol both in its standard version and in an "Enhanced" version, which includes support for H.265 and AV1 codecs.
HTTPAnother protocol is responsible for handling HLS, MPEG-DASH, the Admin Panel, and the REST-API. The default port for the HTTP version of this protocol is 80, while for the SSL version, it is 443.
VHost:isSSLSpecified whenever this virtual host should run though SSL Layer. Please keep in mind that if this field is set to “true” <Certificate> tag is required.
WebSocketsThere is also a protocol responsible for supporting Storm's internal protocol, which is based on the Media Source Extensions mechanism. Like HTTP, its default port is 80, and for the SSL version, it is 443.
Table 2. Available protocols table

Certificate Files

In order to enable SSL layer a proper JKS file containing a key & certificate is required. This is a standard for all Java-based application. If you wish to learn how to create a proper JKS file, please check our tutorial, that you can see here.

Docker Configuration

If the Storm Streaming Server operates within a Docker environment, it's important to remember that all sockets are created inside the container, not on the host device (unless configured otherwise) . Therefore, you should always use "*" when declaring the host and remember to forward these ports outside of the container during its creation. By default, a Docker container with the Storm Streaming Server image forwards ports 1935 and 8080. Additional ports can be added as needed.


<VHosts>
    <VHost host="*" port="1935" isSSL="false">
        <Protocols>RTMP</Protocols>
    </VHost>
    <VHost host="*" port="8080" isSSL="false">
        <Protocols>WEBSOCKETS, HTTP</Protocols>
    </VHost>
</VHosts>

Verification

For verification, please check logs or console output messages. You should see something like that:


14:50:25 INFO  Config - vHost :: 192.168.10.3:1935 | SSL: false | RTMP
14:50:25 INFO  Config - vHost :: 192.168.10.3:8080 | SSL: false | WEBSOCKETS, HTTP

SSL Nginx Passthrough

Please keep in mind that for production workloads Java SSL Engine might not be ideal in terms of pure performance. We highly advise combining Storm Streaming Server with Nginx for SSL Encryption/Decryption. You can learn how to do this here.

Next Step

In the next step you'll learn how to configure basic Live Application.

Support Needed?

Create a free ticket and our support team will provide you necessary assistance.