# Cross domain policy woes

**URL:** <https://forum.kirupa.com/t/cross-domain-policy-woes/301488>\
**Category:** Uncategorized\
**Created:** [December 9, 2009, 11:36pm UTC](https://forum.kirupa.com/t/cross-domain-policy-woes/301488 "2009-12-09T23:36:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gathan](https://avatars.discourse-cdn.com/v4/letter/g/df705f/32.png) [@Gathan](https://forum.kirupa.com/u/Gathan)\
**Post date:** [December 9, 2009, 11:36pm UTC](https://forum.kirupa.com/t/cross-domain-policy-woes/301488/1 "2009-12-09T23:36:25Z")

</div>

So I thought, shouldn’t be much of a trouble to connect to a socket server from a different domain.Oh boy how wrong I was!  
After several days of frustration, looking over multiple love docs, boards, etc, you get the picture I really haven’t gotten anywhere figuring out why its not working.  
My connection routine is simple, load up a file policy from the server and then connect to it.

```auto

function connect() {
    Security.loadPolicyFile("xmlsocket://"+"someip"+":"+"1050");
    socket.connect("someip, "1050");
}

```

And then from the java server it waits for one of the policy file requests and then sends the policy file back like

```auto

if (packet == "<policy-file-request/>") {
 String policyFile = "<?xml version=\"1.0\"?><cross-domain-policy><allow-access-from-domain=\"*\" to-ports=\"*\" /></cross-domain-policy>\u0000";
 send (policyFile);

```

Now its not a communication issue as it receives the request from the client just fine.  
However when I attempt to connect to the server from the web server I’m given a

> 

ERROR #2048: security sandbox violation  
[http://www.someurl.com/someswf.swf](http://www.someurl.com/someswf.swf) cannot load data from someip

Sigh anybody got any ideas?:puzzled:
