Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by boolpae · Jul 16, 2011 at 09:34 AM · socketcrossdomain

socket and crossdomain problem (Security.PrefetchSocketPolicy )




In testing, i got a error about corssdomain.

If each server's ip address is different....
If i call 'Security.PrefetchSocketPolicy', webplayer talk to me...
SecurityException: Unable to connect, as no valid crossdomain policy was found

my crossdomain policy ...

<cross-domain-policy> <allow-access-from domain="*" to-ports="*"/> </cross-domain-policy>




I made 'socket server' as follows... (client unity is webplayer version)

1) Policy-server : If unity API call policy, will send crossdomain plicy.
2) Login-server : check users login
3) Lobby-server : make room, play game




  • TEST 1

  1. All servers located on same IP address (111.111.111.111)

  2. load unity webplayer

  3. API call 'Security.PrefetchSocketPolicy( 111.111.111.111, port)' to connect Login-server

  4. Policy-server send policy packet.

  5. connect Login-server and then... check login

  6. And then... move Lobby-server

  7. API call 'Security.PrefetchSocketPolicy( 111.111.111.111, port)' to connect Lobby-server

  8. Policy-server send policy packet.

  9. connect Lobby-server and then... make room and play.



TEST 2
1. It is same test flow. but server's IP address is different.

2. 'Policy-server' + 'Login-server' locate on 111.111.111.111
3. 'Policy-server' + 'Lobby-server' locate on 111.111.111.222
4. " load webplayer -> Policy-server -> Login-server " is success.
5. and then IP is change 111.111.111.111 -> 111.111.111.222
6. policy-server-> Lobby-server is fail.
"SecurityException: Unable to connect, as no valid crossdomain policy was found"*



"TEST-1" is success. (no problem)
"TEST-2" is fail.


I have a question.
If server's IP is different, what can adjust crossdomain policy ?

Thank you for read my question :)


Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Bunny83 · Jul 16, 2011 at 12:46 PM

I'm a bit confused by your explanations. If you have two different servers behind two different IPs and you want to connect to them, each server have to provide a cross-domain-policy. Are you sure that both servers provide the policy?

You only need to call Security.PrefetchSocketPolicy when you want to use a different port (not 843) for the policy check, otherwise Unity is fetching the policy automatically from the requested IP at port 843.

Also keep in mind that TCP connections need to check the policy only once. UDP will check the policy every packet that is send since it's connection-less. Using udp sockets in the webplayer is not really recommended ;)

http://unity3d.com/support/documentation/Manual/Security%20Sandbox.html

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Security.PrefetchSocketPolicy problem. 0 Answers

Web Player connection issue. 0 Answers

Policy File is being served, but never recognized 1 Answer

Yet another socket-and-crossdomain-policy question 1 Answer

Uniweb(sockets) + Facebook 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges