# Can't set crossdomain.xml to allow access to connectioncounts from javascript

**URL:** <https://community.wowza.com/t/cant-set-crossdomain-xml-to-allow-access-to-connectioncounts-from-javascript/39990>\
**Category:** Wowza Streaming Engine\
**Created:** [February 22, 2013, 2:45pm UTC](https://community.wowza.com/t/cant-set-crossdomain-xml-to-allow-access-to-connectioncounts-from-javascript/39990 "2013-02-22T14:45:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Richard\_Perez](https://avatars.discourse-cdn.com/v4/letter/r/48db29/32.png) [@Richard\_Perez](https://community.wowza.com/u/Richard_Perez)\
**Post date:** [February 22, 2013, 2:45pm UTC](https://community.wowza.com/t/cant-set-crossdomain-xml-to-allow-access-to-connectioncounts-from-javascript/39990/1 "2013-02-22T14:45:06Z")

</div>

Dear All,

I’m trying to create a javascript code to display connection count. The only problem is that the web server won’t be on the same server than the Wowza Server.

So i’m facing the crossdomain policy problem.

Here is my javascript code :

[HTML]

[/HTML]

I’m getting a crossdomain error

and here is my conf/crossdomain.xml wich seems to be good :

[HTML]

\<?xml version="1.0"?\>

[/HTML]

Could somebody help me?

Best regards

Richard

---

<div class="post-metadata">

**Author:** ![Andrew\_Kennedy1](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@Andrew\_Kennedy1](https://community.wowza.com/u/Andrew_Kennedy1)\
**Post date:** [February 24, 2013, 1:48am UTC](https://community.wowza.com/t/cant-set-crossdomain-xml-to-allow-access-to-connectioncounts-from-javascript/39990/2 "2013-02-24T01:48:46Z")

</div>

Hi,

In your VHost.xml you need to add the crossdomain HTTP Provider to port 8086

If you add

com.wowza.wms.http.HTTPCrossdomain

\*crossdomain.xml

none

As the first entry in the port 8086 HTTP Provider section , restart Wowza it should then work.

Andrew.

---

<div class="post-metadata">

**Author:** ![Jay\_Charles](https://avatars.discourse-cdn.com/v4/letter/j/c89c15/32.png) [@Jay\_Charles](https://community.wowza.com/u/Jay_Charles)\
**Post date:** [February 25, 2013, 7:47am UTC](https://community.wowza.com/t/cant-set-crossdomain-xml-to-allow-access-to-connectioncounts-from-javascript/39990/3 "2013-02-25T07:47:58Z")

</div>

Crossdomain.xml is for flash clients, and AFAIK, none of the current browsers use a similar crossdomain policy system.

Some of the more modern browsers support CORS, so if wowza returns Access-Control-Allow-Origin headers on the response from the connection count service (not sure if it does or not), those browsers should be able to consume the XML response over an xhr request.

For older browsers, you’d need to refactor the connection count service so you can use JSONP, or you could use a proxy application that resides in the same domain as the page that makes the xhr request.

There’s good info on the topic here: [https://www.bionicspirit.com/blog/2011/03/24/cross-domain-requests.html](https://www.bionicspirit.com/blog/2011/03/24/cross-domain-requests.html)

---

<div class="post-metadata">

**Author:** ![Richard\_Perez](https://avatars.discourse-cdn.com/v4/letter/r/48db29/32.png) [@Richard\_Perez](https://community.wowza.com/u/Richard_Perez)\
**Post date:** [February 24, 2013, 2:09am UTC](https://community.wowza.com/t/cant-set-crossdomain-xml-to-allow-access-to-connectioncounts-from-javascript/39990/4 "2013-02-24T02:09:03Z")

</div>

Id did not try your solution (but it seems less complex) but i have found another wich is available in another thread :

> [@Accessing Connection Count XML Information - Cross-Domain](http://community.wowza.com/t/-/35704):
>
> I’ve written some javascript (using jquery) that will access the wowza server’s built-in connectioncounts information. It takes this XML information, cleans it up, and displays the information in an easy-to-read HTML page. Everything works great – on the localhost (on my personal computer)… but as soon as I place the HTML and javascript on an actual server (using Amazon S3 in this case) it doesn’t work. I’m assuming there is a crossdomain issue. I have the crossdomain.xml file in wowza’s conf …

Thank you for your help.

Best regards

Richard
