# HTTProvider that returns server, vhost, application, appInstance, stream conn. counts

**URL:** <https://community.wowza.com/t/httprovider-that-returns-server-vhost-application-appinstance-stream-conn-counts/84>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-streaming-server-java-api\
**Created:** [November 13, 2009, 10:31am UTC](https://community.wowza.com/t/httprovider-that-returns-server-vhost-application-appinstance-stream-conn-counts/84 "2009-11-13T10:31:23Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/system/32/447_2.png) [@system](https://community.wowza.com/u/system)\
**Post date:** [November 13, 2009, 10:31am UTC](https://community.wowza.com/t/httprovider-that-returns-server-vhost-application-appinstance-stream-conn-counts/84/1 "2009-11-13T10:31:23Z")

</div>

[https://www.wowza.com/docs/how-to-get-connection-counts-for-server-applications-application-instances-and-streams-with-an-http-provider](https://www.wowza.com/docs/how-to-get-connection-counts-for-server-applications-application-instances-and-streams-with-an-http-provider)

---

<div class="post-metadata">

**Author:** ![dave\_love](https://avatars.discourse-cdn.com/v4/letter/d/7cd45c/32.png) [@dave\_love](https://community.wowza.com/u/dave_love)\
**Post date:** [March 10, 2010, 6:05pm UTC](https://community.wowza.com/t/httprovider-that-returns-server-vhost-application-appinstance-stream-conn-counts/84/2 "2010-03-10T18:05:44Z")

</div>

Hi Charlie,

I’m trying to use http://[wowza-ip-address]:8086/connectioncounts to get the xml file with all the data.

I’d like to use that file use that file to store every 15 minutes all the informations on my mysql server.

My problem is that I’m not able to save that file: Internet Explorer shows me the file on screen but if I try to save it IE says:

“XML source file is unavailable for viewing”

If I try to use Automate from network automation to http download the file, I get a empty file.

If I try to use httrak command line to get the file using [http://user:password@](http://user:password@)[wowza-ip-address]:8086/connectioncounts I get Authentication error.

So, could you help me to understand how can I get the xml file?

I need the file to elebarate it using a batch on a mysql server.

I’m doing the same thing with shoutcats and icecast, and we would like to offer our services with Wowza server (we are a streaming provider) so I’m trying to do this thing with the developer license.

Thanks for your help.

Dave

---

<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 17, 2010, 3:49am UTC](https://community.wowza.com/t/httprovider-that-returns-server-vhost-application-appinstance-stream-conn-counts/84/3 "2010-05-17T03:49:52Z")

</div>

We don’t have specific example code for this. There is sample code here:

[http://community.wowza.com/t/-/84](http://community.wowza.com/t/-/84)

Charlie

---

<div class="post-metadata">

**Author:** ![gabriel\_fg](https://avatars.discourse-cdn.com/v4/letter/g/a183cd/32.png) [@gabriel\_fg](https://community.wowza.com/u/gabriel_fg)\
**Post date:** [August 10, 2010, 9:19am UTC](https://community.wowza.com/t/httprovider-that-returns-server-vhost-application-appinstance-stream-conn-counts/84/4 "2010-08-10T09:19:50Z")

</div>

simple php code using simplexml to retrieve datas from the httpProvider:

```auto
$xml = simplexml_load_file("wowzaip:8086/connectioncounts");     
//var_dump($xml);
foreach ($xml->Application as $item) {
    $tmp = (string) $item->Name;
    echo $tmp."<br>";
foreach ($item->ApplicationInstance as $item2) {
    $roomName = (string) $item2->Name;
	$Connections = (string) $item2->ConnectionsCurrent;
	echo $roomName.": ".$Connections."<br>";
	}
	}
}

```

etc…

enjoy !

---

<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:** [March 10, 2010, 5:21pm UTC](https://community.wowza.com/t/httprovider-that-returns-server-vhost-application-appinstance-stream-conn-counts/84/5 "2010-03-10T17:21:32Z")

</div>

The easiest solution is set the HTTProvider’s AuthenticationMethod to none. Look for this in /conf/VHost.xml

```auto
<HTTPProvider>
	<BaseClass>com.wowza.wms.http.HTTPConnectionCountsXML</BaseClass>
	<RequestFilters>connectioncounts*</RequestFilters>
	<AuthenticationMethod>admin-digest</AuthenticationMethod>
</HTTPProvider>

```

And change the AuthenticationMethod to none

```auto
<AuthenticationMethod>none</AuthenticationMethod>

```

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:** [March 28, 2010, 11:58am UTC](https://community.wowza.com/t/httprovider-that-returns-server-vhost-application-appinstance-stream-conn-counts/84/6 "2010-03-28T11:58:02Z")

</div>

“_definst_” is the default Application Instance.

If you publish to:

rtmp://[wowza-address]:1935/test

You are actually publishing

rtmp://[wowza-address]:1935/test/_definst_

If you add an explicit Application Instance part to the rtmp url, that is what will be used:

rtmp://[wowza-address]:1935/test/instance1

A subscribing client will have to also connect to that instance to view the stream.

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:** [April 14, 2010, 11:32am UTC](https://community.wowza.com/t/httprovider-that-returns-server-vhost-application-appinstance-stream-conn-counts/84/7 "2010-04-14T11:32:36Z")

</div>

In some browsers, you might have to select View \> Source from the menu to see the xml.

IE should work without doing that.

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:** [April 15, 2010, 1:09pm UTC](https://community.wowza.com/t/httprovider-that-returns-server-vhost-application-appinstance-stream-conn-counts/84/8 "2010-04-15T13:09:57Z")

</div>

There are several HTTProvider examples with full source here:

[http://community.wowza.com/c/-/10](http://community.wowza.com/c/-/10)

Try these:

[http://community.wowza.com/t/-/84](http://community.wowza.com/t/-/84)

[http://community.wowza.com/t/-/60](http://community.wowza.com/t/-/60)

You have to modify one of /conf/VHost/ HostPort /HTTProviders lists, add your HTTProvider.

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:** [April 21, 2010, 10:41am UTC](https://community.wowza.com/t/httprovider-that-returns-server-vhost-application-appinstance-stream-conn-counts/84/9 "2010-04-21T10:41:08Z")

</div>

Total Connections is at that moment, how many connection there are. If 5 clients are connected at the moment this number will be 5.

ConnectionTotalAccepted is cumulative, since the server was last started. If 20 clients connect successfully since the server was started, this number will be 20.

If you are looking looking at a Load Balancer Listener, which is the server that clients connect to get redirected to edge server (Load Balance Senders) servers, you will see rejected connections because that is how the Load Balancer works: it rejects connections, sends back reject code 302 to the client with the information on which edge to connect to. JW Player and Flowplayer are designed to handle this. They then connect to the edge which accepts the connection.

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:** [July 8, 2010, 11:48am UTC](https://community.wowza.com/t/httprovider-that-returns-server-vhost-application-appinstance-stream-conn-counts/84/10 "2010-07-08T11:48:16Z")

</div>

One way is to modify the HTTProvider so that it only outputs the data you want, in which case you could provide a querystring with app name to filter on. See this post for how to parse querystring:

[http://community.wowza.com/t/-/245](http://community.wowza.com/t/-/245)

Another way is to take the whole output and use an xml parser to extract. Here is a couple of user post that explore that with php.

[http://community.wowza.com/t/-/34374#3](http://community.wowza.com/t/-/34374#3)

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:** [November 28, 2010, 1:44pm UTC](https://community.wowza.com/t/httprovider-that-returns-server-vhost-application-appinstance-stream-conn-counts/84/11 "2010-11-28T13:44:36Z")

</div>

A Wowza admin is in development. But I don’t have a time frame for its release.

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:** [October 26, 2011, 10:47am UTC](https://community.wowza.com/t/httprovider-that-returns-server-vhost-application-appinstance-stream-conn-counts/84/12 "2011-10-26T10:47:37Z")

</div>

I’m not sure about the Wowza admin, but it’s not imminent.

Richard

---

<div class="post-metadata">

**Author:** ![Ivan\_Florin](https://avatars.discourse-cdn.com/v4/letter/i/dfb087/32.png) [@Ivan\_Florin](https://community.wowza.com/u/Ivan_Florin)\
**Post date:** [July 8, 2010, 12:20pm UTC](https://community.wowza.com/t/httprovider-that-returns-server-vhost-application-appinstance-stream-conn-counts/84/13 "2010-07-08T12:20:06Z")

</div>

Hello,

How is possible to extract on xml only information about one application, for example:

http://[wowza.url]:8086/connectioncounts?application=test

to show:

```auto
<Application>
  <Name>test</Name> 
  <Status>loaded</Status> 
<ConnectionsCurrent>2</ConnectionsCurrent> 
  <ConnectionsTotal>3</ConnectionsTotal> 
  <ConnectionsTotalAccepted>3</ConnectionsTotalAccepted> 
</Application>

```

Only information about what application name i need.

Thanks

---

<div class="post-metadata">

**Author:** ![Rogier\_Versluis](https://avatars.discourse-cdn.com/v4/letter/r/e47c2d/32.png) [@Rogier\_Versluis](https://community.wowza.com/u/Rogier_Versluis)\
**Post date:** [March 28, 2010, 12:23pm UTC](https://community.wowza.com/t/httprovider-that-returns-server-vhost-application-appinstance-stream-conn-counts/84/14 "2010-03-28T12:23:27Z")

</div>

Hello Charly,

I am using this feature now to build my own admin panel.

But I was looking at something, I have an application with multiple streampoints, but I always get this:

```auto
<Application>
  <Name>test</Name> 
  <Status>loaded</Status> 
  <TimeRunning>1454.528</TimeRunning> 
  <ConnectionsCurrent>2</ConnectionsCurrent> 
  <ConnectionsTotal>3</ConnectionsTotal> 
  <ConnectionsTotalAccepted>3</ConnectionsTotalAccepted> 
  <ConnectionsTotalRejected>0</ConnectionsTotalRejected> 
  <MessagesInBytesRate>78872.0</MessagesInBytesRate> 
  <MessagesOutBytesRate>2.0</MessagesOutBytesRate> 
- <ApplicationInstance>
  <Name>_definst_</Name> 
  <TimeRunning>1454.504</TimeRunning> 
  <ConnectionsCurrent>2</ConnectionsCurrent> 
  <ConnectionsTotal>3</ConnectionsTotal> 
  <ConnectionsTotalAccepted>3</ConnectionsTotalAccepted> 
  <ConnectionsTotalRejected>0</ConnectionsTotalRejected> 
  <MessagesInBytesRate>78872.0</MessagesInBytesRate> 
  <MessagesOutBytesRate>2.0</MessagesOutBytesRate> 
- <Stream>
  <Name>alpha</Name> 
  <SessionsFlash>0</SessionsFlash> 
  <SessionsCupertino>0</SessionsCupertino> 
  <SessionsSmooth>0</SessionsSmooth> 
  <SessionsRTSP>0</SessionsRTSP> 
  <SessionsTotal>0</SessionsTotal> 
  </Stream>
- <Stream>
  <Name>omega</Name> 
  <SessionsFlash>0</SessionsFlash> 
  <SessionsCupertino>0</SessionsCupertino> 
  <SessionsSmooth>0</SessionsSmooth> 
  <SessionsRTSP>0</SessionsRTSP> 
  <SessionsTotal>0</SessionsTotal> 
  </Stream>
  </ApplicationInstance>
  </Application>

```

Is it possible to break up the mountpoints so that I have for each own the bytes in and out?

I can’t really figure out what _definst_ does in this context?

---

<div class="post-metadata">

**Author:** ![Rogier\_Versluis](https://avatars.discourse-cdn.com/v4/letter/r/e47c2d/32.png) [@Rogier\_Versluis](https://community.wowza.com/u/Rogier_Versluis)\
**Post date:** [March 28, 2010, 1:05pm UTC](https://community.wowza.com/t/httprovider-that-returns-server-vhost-application-appinstance-stream-conn-counts/84/15 "2010-03-28T13:05:43Z")

</div>

Ah thanks, that wasn’t very clear, but it seems to work now yes!

That option is perfect because now I can monitor per publishpoint the IO data. Thanks!

---

<div class="post-metadata">

**Author:** ![dave\_love](https://avatars.discourse-cdn.com/v4/letter/d/7cd45c/32.png) [@dave\_love](https://community.wowza.com/u/dave_love)\
**Post date:** [March 10, 2010, 6:54pm UTC](https://community.wowza.com/t/httprovider-that-returns-server-vhost-application-appinstance-stream-conn-counts/84/16 "2010-03-10T18:54:18Z")

</div>

thanks Richard,

without the AuthenticationMethod it works.

But I’ve changed the folliìowing section:

com.wowza.wms.http.HTTPConnectionCountsXML

connectioncounts\*

none

Thanks again for your answer, you have helped me to bypass a serious problem for me.

ciao

Dave

---

<div class="post-metadata">

**Author:** ![Alejandro\_Ferrari](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@Alejandro\_Ferrari](https://community.wowza.com/u/Alejandro_Ferrari)\
**Post date:** [June 19, 2010, 3:28am UTC](https://community.wowza.com/t/httprovider-that-returns-server-vhost-application-appinstance-stream-conn-counts/84/17 "2010-06-19T03:28:53Z")

</div>

Hi ffsdff,

We can help you with your request.

Please contact us: support[@]wmconsulting.info

Regards,

Alejandro

---

<div class="post-metadata">

**Author:** ![Andrew\_Kennedy](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@Andrew\_Kennedy](https://community.wowza.com/u/Andrew_Kennedy)\
**Post date:** [November 27, 2010, 3:15pm UTC](https://community.wowza.com/t/httprovider-that-returns-server-vhost-application-appinstance-stream-conn-counts/84/18 "2010-11-27T15:15:58Z")

</div>

add

[php]

\<?php [/php] at the beginning and [php] ?\>

[/php]

at the end ?

Shamrock

---

<div class="post-metadata">

**Author:** ![Andrew\_Kennedy](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@Andrew\_Kennedy](https://community.wowza.com/u/Andrew_Kennedy)\
**Post date:** [November 28, 2010, 1:06am UTC](https://community.wowza.com/t/httprovider-that-returns-server-vhost-application-appinstance-stream-conn-counts/84/19 "2010-11-28T01:06:25Z")

</div>

Note the wowzaip part, you need to change this to the IP address of your server running Wowza. Please do note PHP is not supported here, although advice can be offered really you do need to source PHP help from a PHP forum.

Shamrock

---

<div class="post-metadata">

**Author:** ![Tun\_Soe](https://avatars.discourse-cdn.com/v4/letter/t/c4cdca/32.png) [@Tun\_Soe](https://community.wowza.com/u/Tun_Soe)\
**Post date:** [June 18, 2010, 4:45pm UTC](https://community.wowza.com/t/httprovider-that-returns-server-vhost-application-appinstance-stream-conn-counts/84/20 "2010-06-18T16:45:18Z")

</div>

I am looking for developer who can make connection count that need to display in my website or inside flash player, control bar.

[Next page](https://community.wowza.com/t/httprovider-that-returns-server-vhost-application-appinstance-stream-conn-counts/84.md?page=2)
