# How to identify current connections for each stream in smil file?

**URL:** <https://community.wowza.com/t/how-to-identify-current-connections-for-each-stream-in-smil-file/50584>\
**Category:** Wowza Developer Dojo\
**Created:** [January 16, 2018, 5:07pm UTC](https://community.wowza.com/t/how-to-identify-current-connections-for-each-stream-in-smil-file/50584 "2018-01-16T17:07:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Denis\_SA](https://avatars.discourse-cdn.com/v4/letter/d/e19b73/32.png) [@Denis\_SA](https://community.wowza.com/u/Denis_SA)\
**Post date:** [January 16, 2018, 5:07pm UTC](https://community.wowza.com/t/how-to-identify-current-connections-for-each-stream-in-smil-file/50584/1 "2018-01-16T17:07:16Z")

</div>

Hi, I try to find out in REST API how to identify current connections to every stream, which are indicated in smil file. I use several streams in smil files for different quality. And point player to smil file via http hls protocol.

I can find information about application and all connections in application. But there are no current connections for every instance (stream) in application

/v2/servers/{serverName}/vhosts/{vhostName}/applications/{appName}/instances/{instanceName}/incomingstreams/{streamName}/monitoring/current

But when we specify smil file like instance in this request we get only all connections for this smil file.

Tell me the direction How to find out how many viewers on each stream from smil file?

thank you

---

<div class="post-metadata">

**Author:** ![Blair\_Liikala](https://avatars.discourse-cdn.com/v4/letter/b/f05b48/32.png) [@Blair\_Liikala](https://community.wowza.com/u/Blair_Liikala)\
**Post date:** [February 17, 2020, 10:31pm UTC](https://community.wowza.com/t/how-to-identify-current-connections-for-each-stream-in-smil-file/50584/2 "2020-02-17T22:31:08Z")

</div>

I’d like to know this too!

---

<div class="post-metadata">

**Author:** ![Rose\_Power-Wowza\_Com](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/rose_power-wowza_com/32/431_2.png) [@Rose\_Power-Wowza\_Com](https://community.wowza.com/u/Rose_Power-Wowza_Com)\
**Post date:** [March 4, 2020, 7:22pm UTC](https://community.wowza.com/t/how-to-identify-current-connections-for-each-stream-in-smil-file/50584/3 "2020-03-04T19:22:31Z")

</div>

Hello @Blair Liikala I just saw this was never answered- so sorry about that.

For HTTP sessions, you can implement the IVHostHTTPStreamerRequestValidator interface in order to check all incoming HTTP sessions. You can then have code that tracks the sessions, increments them, and checks when it changes the bitrate requested in the chunk request ID. You can identify each session through the session ID.

For example:

```auto
public class HTTPRequestHandler implements IVHostHTTPStreamerRequestValidator{public boolean validateHTTPStreamerRequest(RtmpRequestMessage arg0,HostPort arg1, String arg2) { // check request pathreturn true;}

```

Create the class that sets the validator via the IVHostNotify interface:

```auto
public class VHostListener implements IVHostNotify{

public void onVHostCreate(IVHost vhost) 

{vhost.setHTTPStreamerRequestValidator(new HTTPRequestHandler());

}

}

```

Add it as a vhost listener within your conf/Server.xml file as follows:

```auto
<VHostListeners>

<VHostListener>

<BaseClass>path.to.your.VHostListener</BaseClass>

</VHostListener></VHostListeners>

```
