# Possible to add HTTP header to the playlis and mainfest requests

**URL:** <https://community.wowza.com/t/possible-to-add-http-header-to-the-playlis-and-mainfest-requests/37658>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-streaming-server-java-api\
**Created:** [November 22, 2011, 11:05am UTC](https://community.wowza.com/t/possible-to-add-http-header-to-the-playlis-and-mainfest-requests/37658 "2011-11-22T11:05:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joe\_Xander\_Romero](https://avatars.discourse-cdn.com/v4/letter/j/dfb087/32.png) [@Joe\_Xander\_Romero](https://community.wowza.com/u/Joe_Xander_Romero)\
**Post date:** [November 22, 2011, 11:05am UTC](https://community.wowza.com/t/possible-to-add-http-header-to-the-playlis-and-mainfest-requests/37658/1 "2011-11-22T11:05:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [November 22, 2011, 7:13pm UTC](https://community.wowza.com/t/possible-to-add-http-header-to-the-playlis-and-mainfest-requests/37658/2 "2011-11-22T19:13:25Z")

</div>

Try

```auto
httpSession.setUserHTTPHeader(name, value);

```

Richard

---

<div class="post-metadata">

**Author:** ![Charlie\_Good](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/charlie_good/32/383_2.png) [@Charlie\_Good](https://community.wowza.com/u/Charlie_Good)\
**Post date:** [November 22, 2011, 12:04pm UTC](https://community.wowza.com/t/possible-to-add-http-header-to-the-playlis-and-mainfest-requests/37658/3 "2011-11-22T12:04:57Z")

</div>

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:

```auto
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:

```auto
http://[wowza-ip-address]:1935/vod/mp4:sample.mp4/playlist.m3u8

```

```auto
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

```

```auto
http://[wowza-ip-address]:1935/vod/mp4:sample.mp4/Manifest

```

```auto
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

```

```auto
http://[wowza-ip-address]:1935/vod/mp4:sample.mp4/manifest.f4m

```

```auto
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

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [November 22, 2011, 7:34pm UTC](https://community.wowza.com/t/possible-to-add-http-header-to-the-playlis-and-mainfest-requests/37658/4 "2011-11-22T19:34:03Z")

</div>

Joe,

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

Richard

---

<div class="post-metadata">

**Author:** ![Joe\_Xander\_Romero](https://avatars.discourse-cdn.com/v4/letter/j/dfb087/32.png) [@Joe\_Xander\_Romero](https://community.wowza.com/u/Joe_Xander_Romero)\
**Post date:** [November 22, 2011, 11:23am UTC](https://community.wowza.com/t/possible-to-add-http-header-to-the-playlis-and-mainfest-requests/37658/5 "2011-11-22T11:23:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Joe\_Xander\_Romero](https://avatars.discourse-cdn.com/v4/letter/j/dfb087/32.png) [@Joe\_Xander\_Romero](https://community.wowza.com/u/Joe_Xander_Romero)\
**Post date:** [November 22, 2011, 11:41am UTC](https://community.wowza.com/t/possible-to-add-http-header-to-the-playlis-and-mainfest-requests/37658/6 "2011-11-22T11:41:37Z")

</div>

All right. Thanks for quick response Richard.

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

–Joe.

---

<div class="post-metadata">

**Author:** ![Joe\_Xander\_Romero](https://avatars.discourse-cdn.com/v4/letter/j/dfb087/32.png) [@Joe\_Xander\_Romero](https://community.wowza.com/u/Joe_Xander_Romero)\
**Post date:** [November 22, 2011, 12:13pm UTC](https://community.wowza.com/t/possible-to-add-http-header-to-the-playlis-and-mainfest-requests/37658/7 "2011-11-22T12:13:49Z")

</div>

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.
