Hi ,
I want to create Module, which reads the http header of the request (iPhone http streaming ) for Authorization.
Till now i am able to create the Module and deploy…i can see below method is getting called for any new http session…
public void onHTTPCupertinoStreamingSessionCreate(HTTPStreamerSessionCupertino httpCupertinoStreamingSession) {}
Question : how to read the http header of request in Module ?
Regards,
Samir.
using your reference above the following should work. It should create a map where you can pull out the additional parameters included in the URL
exampl
http://ip/app/mp4:file.mp4/playlist.m3u8?test=one&this=two&more=three
import com.wowza.util.*;
public void onHTTPCupertinoStreamingSessionCreate(HTTPStreamer SessionCupertino httpCupertinoStreamingSession) {
Map<String, String> queryParams = HTTPUtils.splitQueryStr(httpCupertinoStreamingSession.getQueryStr());
String Firstone = queryParams.get("test");
}
The string Firstone should contain the word one based on the example url.
you might need to do a little debugging as it is off the cuff and not tested.
Shamrock
We do not provide access to the request from the session. We extract data from the request (query params, user agent…). We do not provide direct access.
Charlie
try
String = req.getHeader("Customer-Header");
Shamrock
Sorry my bad, looks like I was looking at the wrong code when I gave you the example.
Apologies.
Shamrock
Hi Shamrock,
Thanks for the revert , actually i am looking for the http header not the parameter.
GET /rtplive/chnl70/playlist.m3u8 HTTP/1.1
Host: 121.241.248.12:1935
Range: bytes=0-1
Accept: /
Accept-Encoding: identity
Connection: keep-alive
User-Agent: AppleCoreMedia/1.0.0.8C148 (iPhone; U; CPU OS 4_2_1 like Mac OS X; ko_kr)
Custom-Header : Value
-Samir.
How do i get the reference of req object from HTTPStreamerSessionCupertino object.
-Samir.
Thanks Charlie, My main purpose to get the header is to diff the request between iPhone browser vs App.