# Simple question for whitelisting IP

**URL:** https://community.wowza.com/t/simple-question-for-whitelisting-ip/92823
**Category:** Wowza Streaming Engine
**Created:** [February 10, 2021, 10:08pm UTC](https://community.wowza.com/t/simple-question-for-whitelisting-ip/92823 "2021-02-10T22:08:47Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Nikolaos\_Tsilikas](https://avatars.discourse-cdn.com/v4/letter/n/5fc32e/32.png) [@Nikolaos\_Tsilikas](https://community.wowza.com/u/Nikolaos_Tsilikas)
#### Post date: [February 10, 2021, 10:08pm UTC](https://community.wowza.com/t/simple-question-for-whitelisting-ip/92823/1 "2021-02-10T22:08:47Z")

</div>

Im using the engine on my own server,  
So is it possible to restrict access to a live stream based on the IP’s Im storing on the fly inside a mysql database?  
Thanks

---

<div class="post-metadata">

### Author: ![Karel\_Boek](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/karel_boek/32/454_2.png) [@Karel\_Boek](https://community.wowza.com/u/Karel_Boek)
#### Post date: [February 12, 2021, 8:31am UTC](https://community.wowza.com/t/simple-question-for-whitelisting-ip/92823/2 "2021-02-12T08:31:25Z")

</div>

For HLS and MPEG-DASH - assumed that clients connect directly to your Wowza Server (thus not via a CDN or proxy; and your Wowza Application is NOT in HTTP Origin mode), you can develop a custom module that overrides the [onHTTPSessionCreate](https://www.wowza.com/resources/serverapi/4.7.0/com/wowza/wms/module/IModuleOnHTTPSession.html#onHTTPSessionCreate(com.wowza.wms.httpstreamer.model.IHTTPStreamerSession)) in ModuleBase. You can check the clients IP address and block access or cancel the session. Remember that this doesn’t keep the client from trying again.

For RTMP you can implement the [IMediaStreamActionNotify](https://www.wowza.com/resources/serverapi/com/wowza/wms/stream/IMediaStreamActionNotify.html), check the client IP in your DB and force-shutdown the client if there’s no match.

---

<div class="post-metadata">

### Author: ![Nikolaos\_Tsilikas](https://avatars.discourse-cdn.com/v4/letter/n/5fc32e/32.png) [@Nikolaos\_Tsilikas](https://community.wowza.com/u/Nikolaos_Tsilikas)
#### Post date: [February 12, 2021, 10:41am UTC](https://community.wowza.com/t/simple-question-for-whitelisting-ip/92823/3 "2021-02-12T10:41:45Z")

</div>

Thank you Karel for your answer.  
Do both of the solutions work if there are more than one viewers?

---

<div class="post-metadata">

### Author: ![Karel\_Boek](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/karel_boek/32/454_2.png) [@Karel\_Boek](https://community.wowza.com/u/Karel_Boek)
#### Post date: [February 12, 2021, 11:19am UTC](https://community.wowza.com/t/simple-question-for-whitelisting-ip/92823/4 "2021-02-12T11:19:05Z")

</div>

As I wrote: assumed that clients connect directly to your Wowza Server (thus not via a CDN or proxy; and your Wowza Application is NOT in HTTP Origin mode)

onHTTPSessionCreate (HLS/MPEG-DASH) and IMediaStreamActionNotify.onPlay (RTMP) are called once when the viewer connects to the stream.

---

<div class="post-metadata">

### Author: ![Nikolaos\_Tsilikas](https://avatars.discourse-cdn.com/v4/letter/n/5fc32e/32.png) [@Nikolaos\_Tsilikas](https://community.wowza.com/u/Nikolaos_Tsilikas)
#### Post date: [February 12, 2021, 7:35pm UTC](https://community.wowza.com/t/simple-question-for-whitelisting-ip/92823/5 "2021-02-12T19:35:57Z")

</div>

Thank you very much for your complete answers!  
And what about WebRTC? What could be done in that case?

---

<div class="post-metadata">

### Author: ![Karel\_Boek](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/karel_boek/32/454_2.png) [@Karel\_Boek](https://community.wowza.com/u/Karel_Boek)
#### Post date: [February 16, 2021, 1:17pm UTC](https://community.wowza.com/t/simple-question-for-whitelisting-ip/92823/6 "2021-02-16T13:17:20Z")

</div>

WebRTC uses RTP; out of my head: you should be able to use the IMediaStreamActionNotify.onPlay and check if there’s a RTP session and check if the RTP session is a WebRTC session.
