Php Socket works on localhost but not on a real domain

So following this tutorial (http://www.kirupa.com/developer/flash8/php5sockets_flash8.htm). I have it working on localhost. In the php server script I used the address “127.0.0.1” and in the flash file I changed the socket connect to null (mySocket.connect(null, 9999);), that way it will take the address of whatever the URL is.

Anyways, now I uploaded the same files to two of my domains. One is a third party hosting, while the other is a computer I have set up to be accessible on the web. The socket server seems to be running, yet when I go to the socket page, the connection fails. Any ideas? Is there some security thing I am not aware of?