Wowza Community

HTTPProvider to handle m3u8 and Manifest requests

I need to rewrite responses to all HTTP requests coming in to a particular Vhost. Specifically, I need to redirect requests for HLS and SmoothStreaming

I’ve written a class that extends HTTProvider2Base, and added the HTTPProvider to my Vhost.xml

Everything works fine if .m3u8 or /Manifest is not present in the request url, but if they are, it seems the HTTP provider is not invoked

For example, the following works as expected:

h**p://[server-ip]/application/instance/streamname/playlist?var1=foo&var2=bar

… but the following just returns the same output as would be if the HTTP provider was not implemented:

h**p://[server-ip]/application/instance/streamname/playlist.m3u8?var1=foo&var2=bar

h**p://[server-ip]/application/instance/streamname/Manifest?var1=foo&var2=bar

What do I need to do to allow my HTTPProvider to handle .m3u8 and Manifest requests?

Thanks.

This is controlled in conf/HTTPStreamers.xml. The RequestFilters for the HTTP Streamers are executed first. You will need to disable these to intercept these requests. You can turn off HTTP Streams by removing them from the HTTPStreamerAdapters list in conf/VHost.xml:

<HTTPStreamerAdapters>
	<HTTPStreamerAdapter>
		<ID>smoothstreaming</ID>
		<Name>smoothstreaming</Name>
		<Properties>
		</Properties>
	</HTTPStreamerAdapter>
	<HTTPStreamerAdapter>
		<ID>cupertinostreaming</ID>
		<Name>cupertinostreaming</Name>
		<Properties>
		</Properties>
	</HTTPStreamerAdapter>
	<HTTPStreamerAdapter>
		<ID>sanjosestreaming</ID>
		<Name>sanjosestreaming</Name>
		<Properties>
		</Properties>
	</HTTPStreamerAdapter>
	<HTTPStreamerAdapter>
		<ID>webmstreaming</ID>
		<Name>webmstreaming</Name>
		<Properties>
		</Properties>
	</HTTPStreamerAdapter>
</HTTPStreamerAdapters>

Charlie

Why don’t you do all of this outside of Wowza. Have the inital request from the GSS device go to a web browser that redirects to Wowza. So the web server is doing all the redirect and not Wowza. Always send the initial request from the load balancer to the web server.

Charlie

Thanks Charlie… but I don’t want to disable HTTP streaming. Perhaps if I elaborate…

The network I’m working with is behind a GSS balancer so we can handle geolocation as well as load balancing. The problem I face is that the GSS solution implemented by my client’s datacenter does not support HOST header rewrites, and has a stickiness timeout of 20 minutes.

So, when an HTTP request is made to the domain of the GSS, the request received by the target wowza host has the GSS hostname in the request URL. This is fine for RTMP and RTSP, but for HTTP requests, once the GSS timeout expires, the next HTTP request from the client can end up on a different Wowza host, and then the stream breaks.

So, what I want to do is, when a playlist or manifest request comes in to a Wowza host, I want that Wowza to redirect to itself, replacing the GSS hostname with the internet facing IP of the Wowza host.

I suppose I could formulate request URLs so they don’t include .m3u8 or /Manifest, but that would mean breaking from the typical Wowza URL structure, and I’d prefer to avoid that.

Ideas?

Oh… I think I see it now. I can change the request filters in HTTPStreamers.xml so they don’t grab the requests, and then provide an alternate extension in the redirect that the HTTPStreamers will pick up.

does that seem reasonable? Anything I’m not considering in that approach?

I had considered that, but the trouble there is that I’d then need the application on the webservers (there’s a cluster of those too) to be aware of the state of each Wowza host. That means development of another application, and an additional point of configuration when Wowza servers are put into/removed from service. Since the GSS is already keeping track of uptime on the Wowza hosts, I’d prefer to handle redirection with Wowza