# Get client IP from IHTTPStreamerSession

**URL:** <https://community.wowza.com/t/get-client-ip-from-ihttpstreamersession/35903>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-streaming-server-java-api\
**Created:** [May 11, 2011, 2:17pm UTC](https://community.wowza.com/t/get-client-ip-from-ihttpstreamersession/35903 "2011-05-11T14:17:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simon\_Ostergren](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@Simon\_Ostergren](https://community.wowza.com/u/Simon_Ostergren)\
**Post date:** [May 11, 2011, 2:17pm UTC](https://community.wowza.com/t/get-client-ip-from-ihttpstreamersession/35903/1 "2011-05-11T14:17:13Z")

</div>

When I’m print out client IP from resolvePlayAlias method the IP is null.

Any ideas how to get the correct IP from IHTTPStreamerSession? It works for RTPSession with method rtpSession.getIp().

```auto
public class TestModule extends ModuleBase implements IMediaStreamNameAliasProvider2 {

	public String resolvePlayAlias(IApplicationInstance appInstance, String name, IHTTPStreamerSession httpSession) {
		

		String ipAddressClient = httpSession.getIpAddress();
		
		getLogger().info("Client IP: " + ipAddressClient);
		return null;
	}
	(...)
}

```

**Result:**

INFO server comment - Client IP: null

---

<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:** [May 11, 2011, 3:15pm UTC](https://community.wowza.com/t/get-client-ip-from-ihttpstreamersession/35903/2 "2011-05-11T15:15:10Z")

</div>

If you are using smil file, resolvePlayAlias will run once for the smil, then again for each item. I think the first pass for the smil will have null IpAddress, but the items should have it

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:** [August 23, 2011, 4:47pm UTC](https://community.wowza.com/t/get-client-ip-from-ihttpstreamersession/35903/3 "2011-08-23T16:47:41Z")

</div>

There were some updates in Patch 2:

[https://www.wowza.com/downloads/WowzaMediaServer-2-2-4/WowzaMediaServer2.2.4-patch2.zip](https://www.wowza.com/downloads/WowzaMediaServer-2-2-4/WowzaMediaServer2.2.4-patch2.zip)

I’m not sure about HTTPSession when the smil is passed thru.

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:** [August 23, 2011, 10:30pm UTC](https://community.wowza.com/t/get-client-ip-from-ihttpstreamersession/35903/4 "2011-08-23T22:30:24Z")

</div>

Great, thanks for the update, glad it’s working

Richard

---

<div class="post-metadata">

**Author:** ![Jiri\_Volejnik](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@Jiri\_Volejnik](https://community.wowza.com/u/Jiri_Volejnik)\
**Post date:** [August 23, 2011, 5:43pm UTC](https://community.wowza.com/t/get-client-ip-from-ihttpstreamersession/35903/5 "2011-08-23T17:43:24Z")

</div>

Hi,

I would appreciate having it working, too. Would it be possible to add it to the wish list, please?

We generate smils dynamically, on the fly. Our module calls the application server, passing query string and IP address of the original request to it. The server needs the IP address for smil content generation (security and geo ip).

Note:

The resolvePlayAlias method gets called first, and session.getIpAddress returns null at the moment. Then, onHTTPSessionCreate gets called - and IP address is already available.

Thanks,

Jiri

---

<div class="post-metadata">

**Author:** ![Jiri\_Volejnik](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@Jiri\_Volejnik](https://community.wowza.com/u/Jiri_Volejnik)\
**Post date:** [August 23, 2011, 6:47pm UTC](https://community.wowza.com/t/get-client-ip-from-ihttpstreamersession/35903/6 "2011-08-23T18:47:06Z")

</div>

Wow, great, that patch solves it!

Many thanks!

Jiri
