# Getting the hostname for the request in the Random Access Reader class

**URL:** https://community.wowza.com/t/getting-the-hostname-for-the-request-in-the-random-access-reader-class/34144
**Category:** Wowza Streaming Engine
**Created:** [April 24, 2012, 4:48pm UTC](https://community.wowza.com/t/getting-the-hostname-for-the-request-in-the-random-access-reader-class/34144 "2012-04-24T16:48:08Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Vijay\_J](https://avatars.discourse-cdn.com/v4/letter/v/d78d45/32.png) [@Vijay\_J](https://community.wowza.com/u/Vijay_J)
#### Post date: [April 24, 2012, 4:48pm UTC](https://community.wowza.com/t/getting-the-hostname-for-the-request-in-the-random-access-reader-class/34144/1 "2012-04-24T16:48:08Z")

</div>

Hi,

We’re using a customized version of the Random Access Reader class and would like to use the hostname of the incoming request to determine what HTTP server to proxy from. Is there a way to get this information in the init() method?

```auto
public void init(IApplicationInstance appInstance, IMediaStream stream, String basePath, String mediaName, String mediaExtension) {}

```

Thanks,

Vijay

---

<div class="post-metadata">

### Author: ![Jason\_Hilton](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/jason_hilton/32/437_2.png) [@Jason\_Hilton](https://community.wowza.com/u/Jason_Hilton)
#### Post date: [April 25, 2012, 9:55am UTC](https://community.wowza.com/t/getting-the-hostname-for-the-request-in-the-random-access-reader-class/34144/2 "2012-04-25T09:55:16Z")

</div>

Hi

You can’t do it like that you would need to use a prior method that is called first.

Try this as a starting point,

[https://www.wowza.com/docs/how-to-select-audio-data-and-or-video-channel-from-a-multi-channel-mp4-file-by-using-imediareaderactionnotify](https://www.wowza.com/docs/how-to-select-audio-data-and-or-video-channel-from-a-multi-channel-mp4-file-by-using-imediareaderactionnotify)

The code here may suit your needs better.

Jason

---

<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: [April 25, 2012, 2:58pm UTC](https://community.wowza.com/t/getting-the-hostname-for-the-request-in-the-random-access-reader-class/34144/3 "2012-04-25T14:58:01Z")

</div>

The only way would be through stream.getHTTPStreamerSession(). There is a chance that is populated at that point in time and you can get the domain through the HTTP session.

Charlie

---

<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: [April 26, 2012, 11:21am UTC](https://community.wowza.com/t/getting-the-hostname-for-the-request-in-the-random-access-reader-class/34144/4 "2012-04-26T11:21:49Z")

</div>

Are you only see this when the RandomAccessReader is used to open a SMIL file? I can see that we use a disconnected IMediaStream to open SMIL files. this stream is not populated with the HTTP session information.

Charlie

---

<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: [April 26, 2012, 2:58pm UTC](https://community.wowza.com/t/getting-the-hostname-for-the-request-in-the-random-access-reader-class/34144/5 "2012-04-26T14:58:42Z")

</div>

I don’t think it is a good idea to rely on this behavior. We can’t guarentee that it will continue to work that way. What exactly are you trying to accomplish. Maybe there is a better way to do it.

Charlie

---

<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: [April 27, 2012, 3:50pm UTC](https://community.wowza.com/t/getting-the-hostname-for-the-request-in-the-random-access-reader-class/34144/6 "2012-04-27T15:50:04Z")

</div>

A more realiable way to do this might be to use the alias system. You can intercept and re-write any stream names using the alias system. The alias system also has access to full HTTPSession in all states of processing.

[https://www.wowza.com/docs/how-to-use-the-imediastreamnamealiasprovider2-interface](https://www.wowza.com/docs/how-to-use-the-imediastreamnamealiasprovider2-interface)

Be sure you are running the latest version of Wowza Server since there were changes later in 3.x cycle to fix a few small problems with HTTPsessions relating to aliases. It should be a much more reliable way to do it.

Charlie

---

<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: [May 1, 2012, 6:51am UTC](https://community.wowza.com/t/getting-the-hostname-for-the-request-in-the-random-access-reader-class/34144/7 "2012-05-01T06:51:04Z")

</div>

I did make a small change here that will populate the HTTP session value of the stream when reading a smil file where HTTP session is available.

[WowzaMediaServer3.1.1-patch1.zip](https://www.wowza.com/downloads/WowzaMediaServer-3-1-1/WowzaMediaServer3.1.1-patch1.zip)

Charlie

---

<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: [May 14, 2012, 6:34am UTC](https://community.wowza.com/t/getting-the-hostname-for-the-request-in-the-random-access-reader-class/34144/8 "2012-05-14T06:34:19Z")

</div>

It looks like you are getting socket errors in the http reader which is leading to the problem. I can send you a copy of the most recent http byte reader code to help you debug. Please let me know if you need this. Better to send email to support@wowza.com.

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: [December 26, 2012, 9:52pm UTC](https://community.wowza.com/t/getting-the-hostname-for-the-request-in-the-random-access-reader-class/34144/9 "2012-12-26T21:52:59Z")

</div>

It should work. Make sure you have the latest version of Wowza

[https://www.wowza.com/docs/wowza-streaming-engine-software-updates](https://www.wowza.com/docs/wowza-streaming-engine-software-updates)

Richard

---

<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: [December 28, 2012, 6:42pm UTC](https://community.wowza.com/t/getting-the-hostname-for-the-request-in-the-random-access-reader-class/34144/10 "2012-12-28T18:42:47Z")

</div>

Referring to this example:

[https://www.wowza.com/docs/how-to-control-access-to-http-streams-cupertinostreaming-sanjosestreaming-smoothstreaming-mpegdashstreaming](https://www.wowza.com/docs/how-to-control-access-to-http-streams-cupertinostreaming-sanjosestreaming-smoothstreaming-mpegdashstreaming)

Try:

```auto
httpSession.getHTTPHeader("host");

```

Richard

---

<div class="post-metadata">

### Author: ![Vijay\_J](https://avatars.discourse-cdn.com/v4/letter/v/d78d45/32.png) [@Vijay\_J](https://community.wowza.com/u/Vijay_J)
#### Post date: [April 25, 2012, 1:34pm UTC](https://community.wowza.com/t/getting-the-hostname-for-the-request-in-the-random-access-reader-class/34144/11 "2012-04-25T13:34:14Z")

</div>

We’re already using a custom module that overrides play(), onHTTPCupertinoStreamingSessionCreate(), onHTTPSmoothStreamingSessionCreate() and onRTPSessionCreate() for RTMP, HLS, Silverlight and RTSP respectively. In the case of RTMP and RTSP, the play() and onRTPSessionCreate() methods are called first. The problem we’re facing is with HLS. Wowza calls the init() method in the RandomAccessReader class first before it gets to onHTTPCupertinoStreamingSessionCreate(). And when we’re dealing with SMIL files, every time there’s a bitrate switch, it’s the init() method that’s called.

Here is a snippet of our wowza logs for an HLS request. I added the MediaReaderListener to our custom module as well. As you can see, after the application starts, only the onMediaReaderCreate method is called after which it jumps to the init() method in our custom Random Access Reader class.

```auto
2012-04-25 14:18:57 INFO application app-start _definst_ vod/_definst_
2012-04-25 14:18:57 INFO server comment - MediaReaderListener onMediaReaderCreate
2012-04-25 14:18:57 INFO server comment - CustomRandomAccessReader.init: basePath:/vol1/ mediaName:test.mp4 extension:mp4 

```

Vijay

---

<div class="post-metadata">

### Author: ![Vijay\_J](https://avatars.discourse-cdn.com/v4/letter/v/d78d45/32.png) [@Vijay\_J](https://community.wowza.com/u/Vijay_J)
#### Post date: [April 25, 2012, 3:11pm UTC](https://community.wowza.com/t/getting-the-hostname-for-the-request-in-the-random-access-reader-class/34144/12 "2012-04-25T15:11:32Z")

</div>

Unfortunately, it’s not. I am able to get stream.getContextStr() however but that only spits out the path starting with the application name. Was hoping there’s an API for the domain as well.

Vijay

---

<div class="post-metadata">

### Author: ![Vijay\_J](https://avatars.discourse-cdn.com/v4/letter/v/d78d45/32.png) [@Vijay\_J](https://community.wowza.com/u/Vijay_J)
#### Post date: [April 26, 2012, 11:08am UTC](https://community.wowza.com/t/getting-the-hostname-for-the-request-in-the-random-access-reader-class/34144/13 "2012-04-26T11:08:18Z")

</div>

What we’re trying to do is use the hostname to identify the customer so we can pick the appropriate origin server to proxy from. stream.getContextStr() gets us the application name but using that to identify the customer is not going to scale since it would mean creating a custom application for every customer.

---

<div class="post-metadata">

### Author: ![Vijay\_J](https://avatars.discourse-cdn.com/v4/letter/v/d78d45/32.png) [@Vijay\_J](https://community.wowza.com/u/Vijay_J)
#### Post date: [April 26, 2012, 11:36am UTC](https://community.wowza.com/t/getting-the-hostname-for-the-request-in-the-random-access-reader-class/34144/14 "2012-04-26T11:36:58Z")

</div>

The init() method in the RandomAccessReader class is always called first for an HLS request regardless of whether it’s a SMIL file or not. However, for a regular HLS stream, onHTTPCupertinoStreamingSessionCreate() is called at a later point. But for SMIL files, whenever there’s a shift to a different bitrate, only the init method is called. And you’re right, I’m unable to even get the sessionId for it.

---

<div class="post-metadata">

### Author: ![Vijay\_J](https://avatars.discourse-cdn.com/v4/letter/v/d78d45/32.png) [@Vijay\_J](https://community.wowza.com/u/Vijay_J)
#### Post date: [April 27, 2012, 2:00pm UTC](https://community.wowza.com/t/getting-the-hostname-for-the-request-in-the-random-access-reader-class/34144/15 "2012-04-27T14:00:44Z")

</div>

We’re tying to pick the appropriate customer origin to proxy content from and serve via our wowza servers. We’d like to identify the customer based on the hostname in the request.

For example, customer foo makes the following HLS request to our wowza servers (where [foo.cdn.com](http://foo.cdn.com) is a CNAME to our wowza server):

```auto
http://foo.cdn.com:1935/vod/_definst_/Extremists.m4v/playlist.m3u8

```

We’d like to use the hostname ‘[foo.cdn.com](http://foo.cdn.com)’ to determine that this is the customer ‘foo’ and proxy Extremists.m4v from their origin.

---

<div class="post-metadata">

### Author: ![Vijay\_J](https://avatars.discourse-cdn.com/v4/letter/v/d78d45/32.png) [@Vijay\_J](https://community.wowza.com/u/Vijay_J)
#### Post date: [May 1, 2012, 10:22am UTC](https://community.wowza.com/t/getting-the-hostname-for-the-request-in-the-random-access-reader-class/34144/16 "2012-05-01T10:22:28Z")

</div>

Thanks Charlie, I’ll take a look. The stream alias option wouldn’t have worked for us since that would require us to include some sort of identifier in the file path for the customer which is exactly what we want to avoid.

---

<div class="post-metadata">

### Author: ![Vijay\_J](https://avatars.discourse-cdn.com/v4/letter/v/d78d45/32.png) [@Vijay\_J](https://community.wowza.com/u/Vijay_J)
#### Post date: [May 9, 2012, 3:47pm UTC](https://community.wowza.com/t/getting-the-hostname-for-the-request-in-the-random-access-reader-class/34144/17 "2012-05-09T15:47:17Z")

</div>

I upgraded to 3.1.1 patch 1 to try out the change but I’m now having problems serving HLS via a proxy server. Seeing multiple MediaReaderH264Cupertino.fillChunk: java.lang.NullPointerException errors in the logs. No such issues with 3.0.3 patch 12, which is what we’re currently using.

To make sure it’s not something in our customer Random Access Reader class, I compiled the stock HTTPRandomAccessReaderDirect class that’s part of the HTTPRandomAccessReader module and set up a new application to use it.

wowza log snippet when using Wowza 3.0.3 patch 12. HLS playback is successful:

```auto
2012-05-09 15:30:47 INFO application app-start _definst_ vod/_definst_
2012-05-09 15:30:48 INFO server comment - HTTPRandomAccessReaderDirect.init: basePath:/vol1 mediaName:http://xxx.xxx.com/big_buck.mp4 extension:mp4
2012-05-09 15:30:48 INFO server comment - HTTPRandomAccessReaderDirect.init: status:200 length:18165376 lastModified:1336592412000
2012-05-09 15:30:48 INFO server comment - HTTPRandomAccessReaderDirect.init: basePath:/vol1 mediaName:http://xxx.xxx.com/big_buck.mp4 extension:mp4
2012-05-09 15:30:48 INFO server comment - HTTPRandomAccessReaderDirect.init: status:200 length:18165376 lastModified:1336592412000
2012-05-09 15:30:48 INFO server comment - HTTPRandomAccessReaderDirect.open[http://xxx.xxx.com/big_buck.mp4]
2012-05-09 15:30:48 INFO server comment - HTTPRandomAccessReaderDirect.open[http://xxx.xxx.com/big_buck.mp4]
2012-05-09 15:31:07 INFO server comment - HTTPRandomAccessReaderDirect.close[http://xxx.xxx.com/big_buck.mp4]
2012-05-09 15:31:07 INFO server comment - HTTPRandomAccessReaderDirect.close[http://xxx.xxx.com/big_buck.mp4]
2012-05-09 15:31:07 INFO cupertino connect 1855729957 -
2012-05-09 15:31:07 INFO stream create /xxx.xxx.com/big_buck.mp4 -
2012-05-09 15:31:07 INFO server comment - HTTPRandomAccessReaderDirect.init: basePath:/vol1 mediaName:http://xxx.xxx.com/big_buck.mp4 extension:mp4
2012-05-09 15:31:07 INFO server comment - HTTPRandomAccessReaderDirect.init: status:200 length:18165376 lastModified:1336592412000
2012-05-09 15:31:07 INFO server comment - HTTPRandomAccessReaderDirect.init: basePath:/vol1 mediaName:http://xxx.xxx.com/big_buck.mp4 extension:mp4
2012-05-09 15:31:07 INFO server comment - HTTPRandomAccessReaderDirect.init: status:200 length:18165376 lastModified:1336592412000
2012-05-09 15:31:07 INFO server comment - HTTPRandomAccessReaderDirect.open[http://xxx.xxx.com/big_buck.mp4]
2012-05-09 15:31:07 INFO server comment - HTTPRandomAccessReaderDirect.open[http://xxx.xxx.com/big_buck.mp4]
2012-05-09 15:31:26 INFO server comment - HTTPRandomAccessReaderDirect.close[http://xxx.xxx.com/big_buck.mp4]
2012-05-09 15:31:26 INFO server comment - MediaReaderH264Cupertino.indexFile[vod/_definst_/http:/xxx.xxx.com/big_buck.mp4][mp4a.40.2]: AAC Audio info: {MediaCodecInfoAudio: codec:AAC, channels:2, frequency:22050, samplesPerFrame:1024, objectType:LC}
2012-05-09 15:31:26 INFO server comment - MediaReaderH264Cupertino.indexFile[vod/_definst_/http:/xxx.xxx.com/big_buck.mp4][avc1.66.13]: H.264 Video info: {MediaCodecInfoVideo: codec:H264, profile:Baseline, level:1.3, frameSize:320x240, displaySize:320x240, frameRate:15.000000}
2012-05-09 15:31:27 INFO stream play /xxx.xxx.com/big_buck.mp4 -

```

wowza log snippet when using Wowza 3.1.1 patch 1:

```auto
2012-05-09 15:33:44 INFO application app-start _definst_ vod/_definst_
2012-05-09 15:33:44 INFO server comment - HTTPRandomAccessReaderDirect.init: basePath:/vol1 mediaName:http://xxx.xxx.com/big_buck.mp4 extension:mp4
2012-05-09 15:33:44 INFO server comment - HTTPRandomAccessReaderDirect.init: status:200 length:18165376 lastModified:1336592412000
2012-05-09 15:33:44 INFO server comment - HTTPRandomAccessReaderDirect.init: basePath:/vol1 mediaName:http://xxx.xxx.com/big_buck.mp4 extension:mp4
2012-05-09 15:33:44 INFO server comment - HTTPRandomAccessReaderDirect.init: status:200 length:18165376 lastModified:1336592412000
2012-05-09 15:33:44 INFO server comment - HTTPRandomAccessReaderDirect.open[http://xxx.xxx.com/big_buck.mp4]
2012-05-09 15:33:44 INFO server comment - HTTPRandomAccessReaderDirect.open[http://xxx.xxx.com/big_buck.mp4]
2012-05-09 15:33:44 INFO server comment - HTTPRandomAccessReaderDirect.close[http://xxx.xxx.com/big_buck.mp4]
2012-05-09 15:33:44 INFO server comment - HTTPRandomAccessReaderDirect.close[http://xxx.xxx.com/big_buck.mp4]
2012-05-09 15:33:44 INFO cupertino connect 1439261437 -
2012-05-09 15:33:44 INFO stream create /xxx.xxx.com/big_buck.mp4 -
2012-05-09 15:33:44 INFO server comment - HTTPRandomAccessReaderDirect.init: basePath:/vol1 mediaName:http://xxx.xxx.com/big_buck.mp4 extension:mp4
2012-05-09 15:33:44 INFO server comment - HTTPRandomAccessReaderDirect.init: status:200 length:18165376 lastModified:1336592412000
2012-05-09 15:33:44 INFO server comment - HTTPRandomAccessReaderDirect.init: basePath:/vol1 mediaName:http://xxx.xxx.com/big_buck.mp4 extension:mp4
2012-05-09 15:33:44 INFO server comment - HTTPRandomAccessReaderDirect.init: status:200 length:18165376 lastModified:1336592412000
2012-05-09 15:33:44 INFO server comment - HTTPRandomAccessReaderDirect.open[http://xxx.xxx.com/big_buck.mp4]
2012-05-09 15:33:44 INFO server comment - HTTPRandomAccessReaderDirect.open[http://xxx.xxx.com/big_buck.mp4]
2012-05-09 15:33:45 INFO server comment - MediaReaderH264Cupertino.indexFile[vod/_definst_/http:/xxx.xxx.com/big_buck.mp4][mp4a.40.2]: AAC Audio info: {MediaCodecInfoAudio: codec:AAC, channels:2, frequency:22050, samplesPerFrame:1024, objectType:LC}
2012-05-09 15:33:45 INFO server comment - MediaReaderH264Cupertino.indexFile[vod/_definst_/http:/xxx.xxx.com/big_buck.mp4][avc1.66.13]: H.264 Video info: {MediaCodecInfoVideo: codec:H264, profile:Baseline, level:1.3, frameSize:320x240, displaySize:320x240, frameRate:15.000000}
2012-05-09 15:34:19 INFO server comment - HTTPRandomAccessReaderDirect.close[http://xxx.xxx.com/big_buck.mp4]
2012-05-09 15:34:19 INFO server comment - HTTPRandomAccessReaderDirect.close[http://xxx.xxx.com/big_buck.mp4]
2012-05-09 15:34:19 ERROR server comment - HTTPByteReader.sendRequest[http://xxx.xxx.com:80/big_buck.mp4]: java.net.SocketException: Socket closed
2012-05-09 15:34:19 INFO stream destroy /xxx.xxx.com/big_buck.mp4 -
2012-05-09 15:34:19 INFO cupertino disconnect 1439261437 -
2012-05-09 15:34:20 ERROR server comment - MediaReaderH264Cupertino.fillChunk: java.lang.NullPointerException
java.lang.NullPointerException
	at com.wowza.wms.httpstreamer.cupertinostreaming.file.MediaReaderH264Cupertino.fillChunk(Unknown Source)
	at com.wowza.wms.httpstreamer.cupertinostreaming.file.HTTPStreamerCupertinoIndexFile.fillChunk(Unknown Source)
	at com.wowza.wms.httpstreamer.cupertinostreaming.file.HTTPStreamerCupertinoIndexBase.getChunk(Unknown Source)
	at com.wowza.wms.httpstreamer.cupertinostreaming.httpstreamer.HTTPStreamerAdapterCupertinoStreamer.onMediaFile(Unknown Source)
	at com.wowza.wms.httpstreamer.cupertinostreaming.httpstreamer.HTTPStreamerAdapterCupertinoStreamer.serviceMsg(Unknown Source)
	at com.wowza.wms.httpstreamer.cupertinostreaming.httpstreamer.HTTPStreamerAdapterCupertinoStreamer.service(Unknown Source)
	at com.wowza.wms.server.ServerHandler.a(Unknown Source)
	at com.wowza.wms.server.ServerHandler.a(Unknown Source)
	at com.wowza.wms.server.ServerHandler.messageReceived(Unknown Source)
	at com.wowza.wms.server.ServerHandlerThreaded.messageReceived(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain$2.messageReceived(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain.access$900(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(Unknown Source)
	at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(Unknown Source)
	at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain.access$900(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(Unknown Source)
	at org.apache.mina.filter.executor.ExecutorFilter.processEvent(Unknown Source)
	at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
	at java.lang.Thread.run(Thread.java:619)
2012-05-09 15:34:20 INFO stream play http:/xxx.xxx.com/big_buck.mp4 -
2012-05-09 15:34:20 INFO cupertino connect 1439261437 -
2012-05-09 15:34:20 INFO stream create /xxx.xxx.com/big_buck.mp4 -
2012-05-09 15:34:20 INFO server comment - HTTPRandomAccessReaderDirect.init: basePath:/vol1 mediaName:http://xxx.xxx.com/big_buck.mp4 extension:mp4
2012-05-09 15:34:20 INFO server comment - HTTPRandomAccessReaderDirect.init: status:200 length:18165376 lastModified:1336592412000
2012-05-09 15:34:20 INFO server comment - HTTPRandomAccessReaderDirect.init: basePath:/vol1 mediaName:http://xxx.xxx.com/big_buck.mp4 extension:mp4
2012-05-09 15:34:20 INFO server comment - HTTPRandomAccessReaderDirect.init: status:200 length:18165376 lastModified:1336592412000
2012-05-09 15:34:20 INFO server comment - HTTPRandomAccessReaderDirect.open[http://xxx.xxx.com/big_buck.mp4]
2012-05-09 15:34:20 INFO server comment - HTTPRandomAccessReaderDirect.open[http://xxx.xxx.com/big_buck.mp4]
2012-05-09 15:34:20 INFO server comment - MediaReaderH264Cupertino.indexFile[vod/_definst_/http:/xxx.xxx.com/big_buck.mp4][mp4a.40.2]: AAC Audio info: {MediaCodecInfoAudio: codec:AAC, channels:2, frequency:22050, samplesPerFrame:1024, objectType:LC}
2012-05-09 15:34:20 INFO server comment - MediaReaderH264Cupertino.indexFile[vod/_definst_/http:/xxx.xxx.com/big_buck.mp4][avc1.66.13]: H.264 Video info: {MediaCodecInfoVideo: codec:H264, profile:Baseline, level:1.3, frameSize:320x240, displaySize:320x240, frameRate:15.000000}
2012-05-09 15:34:45 INFO server comment - HTTPRandomAccessReaderDirect.close[http://xxx.xxx.com/big_buck.mp4]
2012-05-09 15:34:45 INFO server comment - HTTPRandomAccessReaderDirect.close[http://xxx.xxx.com/big_buck.mp4]
2012-05-09 15:34:45 ERROR server comment - HTTPByteReader.sendRequest[http://xxx.xxx.com:80/big_buck.mp4]: java.net.SocketException: Socket closed
2012-05-09 15:34:45 INFO stream destroy /xxx.xxx.com/big_buck.mp4 -
2012-05-09 15:34:45 INFO cupertino disconnect 1439261437 -
2012-05-09 15:34:45 ERROR server comment - MediaReaderH264Cupertino.fillChunk: java.lang.NullPointerException
java.lang.NullPointerException
	at com.wowza.wms.httpstreamer.cupertinostreaming.file.MediaReaderH264Cupertino.fillChunk(Unknown Source)
	at com.wowza.wms.httpstreamer.cupertinostreaming.file.HTTPStreamerCupertinoIndexFile.fillChunk(Unknown Source)
	at com.wowza.wms.httpstreamer.cupertinostreaming.file.HTTPStreamerCupertinoIndexBase.getChunk(Unknown Source)
	at com.wowza.wms.httpstreamer.cupertinostreaming.httpstreamer.HTTPStreamerAdapterCupertinoStreamer.onMediaFile(Unknown Source)
	at com.wowza.wms.httpstreamer.cupertinostreaming.httpstreamer.HTTPStreamerAdapterCupertinoStreamer.serviceMsg(Unknown Source)
	at com.wowza.wms.httpstreamer.cupertinostreaming.httpstreamer.HTTPStreamerAdapterCupertinoStreamer.service(Unknown Source)
	at com.wowza.wms.server.ServerHandler.a(Unknown Source)
	at com.wowza.wms.server.ServerHandler.a(Unknown Source)
	at com.wowza.wms.server.ServerHandler.messageReceived(Unknown Source)
	at com.wowza.wms.server.ServerHandlerThreaded.messageReceived(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain$2.messageReceived(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain.access$900(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(Unknown Source)
	at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(Unknown Source)
	at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain.access$900(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(Unknown Source)
	at org.apache.mina.filter.executor.ExecutorFilter.processEvent(Unknown Source)
	at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
	at java.lang.Thread.run(Thread.java:619)
2012-05-09 15:34:45 INFO stream play http:/xxx.xxx.com/big_buck.mp4 -
2012-05-09 15:34:45 INFO cupertino connect 1439261437 -
2012-05-09 15:34:45 INFO stream create /xxx.xxx.com/big_buck.mp4 -
2012-05-09 15:34:45 INFO server comment - HTTPRandomAccessReaderDirect.init: basePath:/vol1 mediaName:http://xxx.xxx.com/big_buck.mp4 extension:mp4
2012-05-09 15:34:45 INFO server comment - HTTPRandomAccessReaderDirect.init: status:200 length:18165376 lastModified:1336592412000
2012-05-09 15:34:45 INFO server comment - HTTPRandomAccessReaderDirect.init: basePath:/vol1 mediaName:http://xxx.xxx.com/big_buck.mp4 extension:mp4
2012-05-09 15:34:45 INFO server comment - HTTPRandomAccessReaderDirect.init: status:200 length:18165376 lastModified:1336592412000
2012-05-09 15:34:45 INFO server comment - HTTPRandomAccessReaderDirect.open[http://xxx.xxx.com/big_buck.mp4]
2012-05-09 15:34:45 INFO server comment - HTTPRandomAccessReaderDirect.open[http://xxx.xxx.com/big_buck.mp4]
2012-05-09 15:34:46 INFO server comment - MediaReaderH264Cupertino.indexFile[vod/_definst_/http:/xxx.xxx.com/big_buck.mp4][mp4a.40.2]: AAC Audio info: {MediaCodecInfoAudio: codec:AAC, channels:2, frequency:22050, samplesPerFrame:1024, objectType:LC}
2012-05-09 15:34:46 INFO server comment - MediaReaderH264Cupertino.indexFile[vod/_definst_/http:/xxx.xxx.com/big_buck.mp4][avc1.66.13]: H.264 Video info: {MediaCodecInfoVideo: codec:H264, profile:Baseline, level:1.3, frameSize:320x240, displaySize:320x240, frameRate:15.000000}
2012-05-09 15:35:11 INFO server comment - HTTPRandomAccessReaderDirect.close[http://xxx.xxx.com/big_buck.mp4]
2012-05-09 15:35:11 INFO server comment - HTTPRandomAccessReaderDirect.close[http://xxx.xxx.com/big_buck.mp4]
2012-05-09 15:35:11 ERROR server comment - HTTPByteReader.sendRequest[http://xxx.xxx.com:80/big_buck.mp4]: java.net.SocketException: Socket closed
2012-05-09 15:35:11 INFO stream destroy /xxx.xxx.com/big_buck.mp4 -
2012-05-09 15:35:11 INFO cupertino disconnect 1439261437 -
2012-05-09 15:35:11 ERROR server comment - MediaReaderH264Cupertino.fillChunk: java.lang.NullPointerException
java.lang.NullPointerException
	at com.wowza.wms.httpstreamer.cupertinostreaming.file.MediaReaderH264Cupertino.fillChunk(Unknown Source)
	at com.wowza.wms.httpstreamer.cupertinostreaming.file.HTTPStreamerCupertinoIndexFile.fillChunk(Unknown Source)
	at com.wowza.wms.httpstreamer.cupertinostreaming.file.HTTPStreamerCupertinoIndexBase.getChunk(Unknown Source)
	at com.wowza.wms.httpstreamer.cupertinostreaming.httpstreamer.HTTPStreamerAdapterCupertinoStreamer.onMediaFile(Unknown Source)
	at com.wowza.wms.httpstreamer.cupertinostreaming.httpstreamer.HTTPStreamerAdapterCupertinoStreamer.serviceMsg(Unknown Source)
	at com.wowza.wms.httpstreamer.cupertinostreaming.httpstreamer.HTTPStreamerAdapterCupertinoStreamer.service(Unknown Source)
	at com.wowza.wms.server.ServerHandler.a(Unknown Source)
	at com.wowza.wms.server.ServerHandler.a(Unknown Source)
	at com.wowza.wms.server.ServerHandler.messageReceived(Unknown Source)
	at com.wowza.wms.server.ServerHandlerThreaded.messageReceived(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain$2.messageReceived(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain.access$900(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(Unknown Source)
	at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(Unknown Source)
	at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain.access$900(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(Unknown Source)
	at org.apache.mina.filter.executor.ExecutorFilter.processEvent(Unknown Source)
	at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
	at java.lang.Thread.run(Thread.java:619)
2012-05-09 15:35:11 INFO stream play http:/xxx.xxx.com/big_buck.mp4 -
2012-05-09 15:35:11 INFO cupertino connect 1439261437 -
2012-05-09 15:35:11 INFO stream create /xxx.xxx.com/big_buck.mp4 -
2012-05-09 15:35:11 INFO server comment - HTTPRandomAccessReaderDirect.init: basePath:/vol1 mediaName:http://xxx.xxx.com/big_buck.mp4 extension:mp4
2012-05-09 15:35:11 INFO server comment - HTTPRandomAccessReaderDirect.init: status:200 length:18165376 lastModified:1336592412000
2012-05-09 15:35:11 INFO server comment - HTTPRandomAccessReaderDirect.init: basePath:/vol1 mediaName:http://xxx.xxx.com/big_buck.mp4 extension:mp4
2012-05-09 15:35:11 INFO server comment - HTTPRandomAccessReaderDirect.init: status:200 length:18165376 lastModified:1336592412000
2012-05-09 15:35:11 INFO server comment - HTTPRandomAccessReaderDirect.open[http://xxx.xxx.com/big_buck.mp4]
2012-05-09 15:35:11 INFO server comment - HTTPRandomAccessReaderDirect.open[http://xxx.xxx.com/big_buck.mp4]
2012-05-09 15:35:11 INFO server comment - MediaReaderH264Cupertino.indexFile[vod/_definst_/http:/xxx.xxx.com/big_buck.mp4][mp4a.40.2]: AAC Audio info: {MediaCodecInfoAudio: codec:AAC, channels:2, frequency:22050, samplesPerFrame:1024, objectType:LC}
2012-05-09 15:35:11 INFO server comment - MediaReaderH264Cupertino.indexFile[vod/_definst_/http:/xxx.xxx.com/big_buck.mp4][avc1.66.13]: H.264 Video info: {MediaCodecInfoVideo: codec:H264, profile:Baseline, level:1.3, frameSize:320x240, displaySize:320x240, frameRate:15.000000}
2012-05-09 15:35:36 INFO server comment - HTTPRandomAccessReaderDirect.close[http://xxx.xxx.com/big_buck.mp4]
2012-05-09 15:35:36 INFO server comment - HTTPRandomAccessReaderDirect.close[http://xxx.xxx.com/big_buck.mp4]
2012-05-09 15:35:36 ERROR server comment - HTTPByteReader.sendRequest[http://xxx.xxx.com:80/big_buck.mp4]: java.net.SocketException: Socket closed
2012-05-09 15:35:36 INFO stream destroy /xxx.xxx.com/big_buck.mp4 -
2012-05-09 15:35:36 INFO cupertino disconnect 1439261437 -
2012-05-09 15:35:36 ERROR server comment - MediaReaderH264Cupertino.fillChunk: java.lang.NullPointerException
java.lang.NullPointerException
	at com.wowza.wms.httpstreamer.cupertinostreaming.file.MediaReaderH264Cupertino.fillChunk(Unknown Source)
	at com.wowza.wms.httpstreamer.cupertinostreaming.file.HTTPStreamerCupertinoIndexFile.fillChunk(Unknown Source)
	at com.wowza.wms.httpstreamer.cupertinostreaming.file.HTTPStreamerCupertinoIndexBase.getChunk(Unknown Source)
	at com.wowza.wms.httpstreamer.cupertinostreaming.httpstreamer.HTTPStreamerAdapterCupertinoStreamer.onMediaFile(Unknown Source)
	at com.wowza.wms.httpstreamer.cupertinostreaming.httpstreamer.HTTPStreamerAdapterCupertinoStreamer.serviceMsg(Unknown Source)
	at com.wowza.wms.httpstreamer.cupertinostreaming.httpstreamer.HTTPStreamerAdapterCupertinoStreamer.service(Unknown Source)
	at com.wowza.wms.server.ServerHandler.a(Unknown Source)
	at com.wowza.wms.server.ServerHandler.a(Unknown Source)
	at com.wowza.wms.server.ServerHandler.messageReceived(Unknown Source)
	at com.wowza.wms.server.ServerHandlerThreaded.messageReceived(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain$2.messageReceived(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain.access$900(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(Unknown Source)
	at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(Unknown Source)
	at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain.access$900(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(Unknown Source)
	at org.apache.mina.filter.executor.ExecutorFilter.processEvent(Unknown Source)
	at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
	at java.lang.Thread.run(Thread.java:619)

```

I noticed the same issue when we were evaluating Wowza 3.0.5 if that helps.

---

<div class="post-metadata">

### Author: ![Sean\_Green](https://avatars.discourse-cdn.com/v4/letter/s/977dab/32.png) [@Sean\_Green](https://community.wowza.com/u/Sean_Green)
#### Post date: [December 26, 2012, 1:42pm UTC](https://community.wowza.com/t/getting-the-hostname-for-the-request-in-the-random-access-reader-class/34144/18 "2012-12-26T13:42:43Z")

</div>

Hello, I have the exact same scenario as vjagannathan. I need to know the fully qualified URL of the request, including the domain name (not IP), in order to identifiy the customer. Was this ever verified to work?

---

<div class="post-metadata">

### Author: ![Sean\_Green](https://avatars.discourse-cdn.com/v4/letter/s/977dab/32.png) [@Sean\_Green](https://community.wowza.com/u/Sean_Green)
#### Post date: [December 27, 2012, 10:28am UTC](https://community.wowza.com/t/getting-the-hostname-for-the-request-in-the-random-access-reader-class/34144/19 "2012-12-27T10:28:19Z")

</div>

Hi Richard,

I upgraded to the latest version, but I’m not sure where to get that hostname from. I re-read the above posts, but I don’t understand this: “I did make a small change here that will populate the HTTP session value of the stream when reading a smil file where HTTP session is available.”. Where/how do I get the hostname used in the request? I wish there was a way to just get the raw request (uri) issued by the client…

---

<div class="post-metadata">

### Author: ![Sean\_Green](https://avatars.discourse-cdn.com/v4/letter/s/977dab/32.png) [@Sean\_Green](https://community.wowza.com/u/Sean_Green)
#### Post date: [December 28, 2012, 1:29pm UTC](https://community.wowza.com/t/getting-the-hostname-for-the-request-in-the-random-access-reader-class/34144/20 "2012-12-28T13:29:02Z")

</div>

Thanks Richard.
