Connecting to XMLsocket works only when running on PC

I have done everything in my knowledge and everything i can find in Google to successfully connect to a simple php socket server that I create on my friends server. Here is the problem… I can connect to the server successfully as long as the flash file is not on the server. If I “run” the fla on my computer, it works perfectly. I also sent the SWF to my friend who owns the server and he was able to get it to work running from his computer. He had a security thing at first but was able to change his settings to get it to work. I have tried uploading the swf to one of my servers and run it but it did not work either.

As found in google, I added a crossdomain.xml file to the server and allowed any possible path that could be used. Nothing seems to work unless the flash is running straight off of the users computer. I have also tried the loadPolicyFile and it did not help either. Any help to get this working would be greatly appreciated!