- Home /
cannot connect web player to server, what did I done wrong?
My team try to make a web based version by using Unnity 3.4x but we failed to connect to our game server as in the picture. What is the solution to connect from a web player to server? we doone pretty fine for client based but not the web player.
in the developement phase (Unity3D editor), we do fine for connecting out of sandbox to policy server (using Socket port:843, then connect to game server later) but in deployment stage, the connection to policy server cannot be reached.
Please help!!
Answer by Yoerick · Jan 23, 2012 at 09:16 AM
When you build a unity webplayer project, it will (for security reasons, found here) look for an xml file called "crossdomain.xml". Just make sure there is an xml file present at the location of the webplayer build (on your server) and it allows the right ports and domains.
Thx, Yoerick. I do follow your link then I found that it is about WWW class, but I'm using Socket to connect to policy server (port 843). Sorry if my question confusing you.
again, we can connect through port 843 to policy server in the editor, but when we do from webplayer, the policy server is cannot be connected and it throw the Exception as in picture.
In the screenshot I see you're using xampp, you have to make sure there is a crossdomain.xml file present in the "htdocs" directory. In the xampp control panel press "explore" and then navigate to the htdocs folder and place the xml file there. Also, are you using any server provider like Smartfox, Photon, ...?
I already try that as well, still not work out.
I'm now using my own propritary game server (I do try with Smartfox it won't work as well) I do pretty good job in the editor, it can connect to the policy server and game server easily but not from the webplayer on deployment site.
You have to read further down to the part that says "Implications for use of Sockets:" It's not an easy read but this may help
For your convenience, we provide a small program which simply listens at port 843; when on a connection it receives a request string, it will reply with a valid socket policy. The server code can be found inside the Unity install folder, in Data/Tools/SocketPolicyServer on Windows or /Unity.app/Contents/Tools/SocketPolicyServer on OS X. Note that the pre-built executable can be run on $$anonymous$$ac since it is a $$anonymous$$ono executable. Just type “mono sockpol.exe” to run it.
Answer by josszp · Jun 22, 2012 at 10:23 AM
I met the same problem, I use the photon server. Most important thing is I have no idea at all now. So I need help also. This is my post: http://forum.unity3d.com/threads/140677-How-to-use-the-Security.PrefetchSocketPolicy-!!!!
TO asked : Have you work around, if you do, tell me how, pls!
Answer by josszp · Jun 22, 2012 at 10:08 AM
I met the same problem and also I have no idea. This is my post: http://forum.unity3d.com/threads/140677-How-to-use-the-Security.PrefetchSocketPolicy-!!!!
TO Ask: Have you worked around it, if you have, tell me how pls. Thank you a lot!!!
Your answer
Follow this Question
Related Questions
FTP Upload Files 2 Answers
Web Player build doesn't connect to my server, PC build works fine 0 Answers
Internet Connection Check using 204 HTTPStatusCode 1 Answer
Web-project "Session End" 0 Answers