Wowza Community

Possible to add HTTP header to the playlis and mainfest requests

Is it possible to add a HTTP header to the playlist and manifest requests? I’ve done some testing with a HTTP proxy between and custom headers that I’m trying to keep for the whole session get lost on the playlist/manifest requests. If that is not possible - can I set a “server wide” header for all HTTP respones?

Tried all I could find in IHTTPStreamerCupertinoVODActionNotify2, IMediaListProvider, IMediaListReader and then onHTTPSessionCreate etc… but they are all called after the first playlist request is served.

–Joe.

Try

httpSession.setUserHTTPHeader(name, value);

Richard

I just tested it for all forms of HTTP streaming and it works for me. If I add the following code to a Wowza Server module:

public void onHTTPSessionCreate(IHTTPStreamerSession httpSession)
{
	getLogger().info("ModuleHTTPTestPlayStart.onHTTPSessionCreate: "+httpSession.getSessionId());
	httpSession.setUserHTTPHeader("WowzaTestHeader", "Wowza Rocks");
}

Then I make an initial request to Wowza Server using Firefox with the “Live HTTP Headers” enabled and the following URLs I get the following header values:

http://[wowza-ip-address]:1935/vod/mp4:sample.mp4/playlist.m3u8
http://192.168.1.22:1935/vod/mp4:sample.mp4/playlist.m3u8
GET /vod/mp4:sample.mp4/playlist.m3u8 HTTP/1.1
Host: 192.168.1.22:1935
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
HTTP/1.1 200 OK
Date: Tue, 22 Nov 2011 20:02:40 GMT
Content-Type: application/vnd.apple.mpegurl
Server: FlashCom/3.5.7
Cache-Control: no-cache
WowzaTestHeader: Wowza Rocks
Content-Length: 145

http://[wowza-ip-address]:1935/vod/mp4:sample.mp4/Manifest
http://192.168.1.22:1935/vod/mp4:sample.mp4/Manifest
GET /vod/mp4:sample.mp4/Manifest HTTP/1.1
Host: 192.168.1.22:1935
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
HTTP/1.1 200 OK
Date: Tue, 22 Nov 2011 20:03:43 GMT
Content-Type: text/xml
Server: FlashCom/3.5.7
Cache-Control: no-cache,no-store
Pragma: no-cache
WowzaTestHeader: Wowza Rocks
Content-Length: 1705

http://[wowza-ip-address]:1935/vod/mp4:sample.mp4/manifest.f4m
http://192.168.1.22:1935/vod/mp4:sample.mp4/manifest.f4m
GET /vod/mp4:sample.mp4/manifest.f4m HTTP/1.1
Host: 192.168.1.22:1935
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
HTTP/1.1 200 OK
Date: Tue, 22 Nov 2011 20:04:18 GMT
Content-Type: text/xml
Server: FlashCom/3.5.7
Cache-Control: no-cache
WowzaTestHeader: Wowza Rocks
Content-Length: 1729

It seems to work for me.

Charlie

Joe,

I don’t think what you are looking for is available in Wowza at present. A future version of Wowza might

Richard

Thanks for that Richard.

I know how to set the header - I’m just wondering where I can override the function that handles the playlist/manifest requests - I have the headers working perfectly for everypart of the process for instance the headers are sent as soon as the client requests the playlist.m3u8?SESSIONID but no headers are sent for the first playlist request and that brakes the continuity of the headers.

So perhaps I need to reframe my question:

  • How can I override a function that handles the delivery of the very first playlist/manifest request before a session has been initializes so that I can transmit a header with the HTTP response?

  • If that is not possible can I write my own playlist.m3u8 handler for the first playlist delivery and create the sessionID and initalize the session for the client?

  • Or third option - can we set a global HTTP header for all responses that Wowza makes?

–Joe.

All right. Thanks for quick response Richard.

I’ll try and explore this further and let know if I can find a solution.

–Joe.

Aaahh I figured out what it is!

It’s the first request from Safari on iOS (the two byte request which results in “#E”) - that does not include any headers that are set (which I believe should be filed as bug).

But I would also like to reccomend adding the option of setting global headers on all HTTP responses to solve issues like cross-domain scripting etc.

Would it be possible to see a patch for the Safari request in the near future?

Thanks!

–Joe.