How to configure date headers for HTTP responses from HTTP Providers

By default, Wowza Streaming Engine doesn't enable date headers for HTTP responses from HTTP Providers. In some cases it useful to have a date header to provide synchronization across services.

Note: This article applies to Wowza Streaming Engine 4.6.0.02 and later.

Contents


About date headers Configuration options

About date headers


Date headers for HTTP responses can be configured globally for the Wowza Streaming Engine instance or for individual HTTP Providers. For more information, see Configuration options.

To enable and configure date headers for HTTP responses, you must add one or more of the following properties:

Enable date headers

To enable date headers in HTTP responses from HTTP Providers, add the dateHeaderEnable property:
<Property>
	<Name>dateHeaderEnable</Name>
	<Value>true</Value>
	<Type>Boolean</Type>
</Property>
The default value is false, which disables date headers for HTTP responses. If you set the <Value> to true date headers are enabled.

Specify a date headers format

To specify a format for the date headers in HTTP responses from HTTP Providers, add the dateHeaderFormat property:
<Property>
	<Name>dateHeaderFormat</Name>
	<Value>[format]</Value>
	<Type>string</Type>
</Property>
Where [format] is replaced with a date and time pattern. For example, using the value EEE, d MMM yyyy HH:mm:ss would return the day of the week, date, and time in the following format: Wed, 4 Jul 2001 12:08:56. For more information about valid formats, see Simple Date Formats.

Specify a date headers zone

To specify a zone for the date headers in HTTP responses from HTTP Providers, add the dateHeaderZone property:
<Property>
	<Name>dateHeaderZone</Name>
	<Value>GMT</Value>
	<Type>string</Type>
</Property>
Time zones are interpreted as text if they have names, such the default value of GMT. Optionally, you can append the offset from UTC using the following structure: <zone> <sign><hours>:<minutes>. For example, EST -05:00.

Specify a date headers locale

To specify a locale for the date headers in HTTP responses from HTTP Providers, add the dateHeaderLocale property:
<Property>
	<Name>dateHeaderLocale</Name>
	<Value>en_US</Value>
	<Type>string</Type>
</Property>
The locale ID for any of the Enabled Locales for java.util and java.text Functionality can be specified. For example, en_US is the locale ID for the English language and United States country. By default, the server's configured language and country settings are used. (The server's language and country settings are visible in the access log file when Wowza Streaming Engine starts.)

Configuration options


The date headers can be configured globally for all HTTP Providers or for individual HTTP Providers.

Configure a single HTTP Provider

To configure the date header for a single HTTP Provider, open the [install-dir]/conf/server.xml file in a text editor and add the date header properties to the <HTTPProvider><Properties> section. The following example enables the date header and specifies a specific format and locale:
 
<HTTPProvider>
	<BaseClass>com.wowza.wms.http.HTTPServerVersion</BaseClass>
	<RequestFilters>*</RequestFilters>
	<AuthenticationMethod>none</AuthenticationMethod>
	<Properties>
		<Property>
        		<Name>dateHeaderEnable</Name>
        		<Value>true</Value>
        		<Type>Boolean</Type>
		</Property>
		<Property>
        		<Name>dateHeaderFormat</Name>
        		<Value>EEE, dd MMM yyyy HH:mm:ss z</Value>
        		<Type>String</Type>
		</Property>
		<Property>
        		<Name>dateHeaderLocale</Name>
        		<Value>en_US</Value>
        		<Type>String</Type>
		</Property>
	</Properties>
</HTTPProvider>

Configure date headers globally

To configure the date header globally for all HTTP Providers associated with the VHost, open the [install-dir]/conf/VHost.xml file in a text editor and add the date header properties to the <Properties> section at the bottom of the file.
 
Note: You can override these settings for a specific HTTP provider by editing the <HTTPProvider> section in the [install-dir]/conf/server.xml file. See Example HTTP Provider Configuration.
The following example adds these properties to the VHost.xml file:
		<Property>
        		<Name>dateHeaderEnable</Name>
        		<Value>true</Value>
        		<Type>Boolean</Type>
		</Property>
		<Property>
        		<Name>dateHeaderFormat</Name>
        		<Value>EEE, dd MMM yyyy HH:mm:ss z</Value>
        		<Type>String</Type>
		</Property>
		<Property>
        		<Name>dateHeaderLocale</Name>
        		<Value>en_US</Value>
        		<Type>String</Type>
		</Property>

Originally Published: For Wowza Streaming Engine 4.6.0.02 on 01-31-2017.
 

If you're having problems or want to discuss this article, post in our forum.