Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
1
Question by Chris Aiken · Dec 18, 2010 at 05:14 PM · webplayersocketpolicyserver

SocketPolicyServer Issues

Everyone,

We are having issues with the SocketPolicyServer when trying to use the WebPlayer.

Our app is using async .NET sockets to connect to a small server application that can run either locally, or remotely.

The sockets connection and stream work correctly of course in standalone MAC or PC mode, and EVEN work in the editor when the active build is set to WebPlayer. But, the app does not working correctly when played in the actual webplayer.

To verify that the policy server is running and providing the correct policy file we are manually checking OnApplication.webSecurityEnabled and calling Security.PrefetchSocketPolicy prior to connecting the socket, and all is well!

We are stumped.. What magic incantation do we need to get this work?

Does anyone have an example of .NET sockets and the policy server working in a webplayer?

Also, is there some more details regarding the policy when using .NET sockets?

We are pretty sure that it is NOT a policy server problem since we have actually the same results with our server app or with Sockpol.exe.

Actually we just integrated the SockPol.cs code into our VS2010 server app, so are confident the response is well formed.

At the moment we think that there is either a bug in the Webplayer, or some missing notation required in the policy response that is not well-documented.

Thanks in advance for any help or information.

Aiken Dev/AikenLabs

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by soonts · Mar 21, 2011 at 12:26 PM

Are you trying to run the server locally? I did and failed: no matter what, unity complained about the missing policy.

After I moved the server to another machine, everything worked OK.

I suspect damn web player intentionally blocks socket communications with the localhost.

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
avatar image
0

Answer by hazmat · Oct 16, 2012 at 09:26 PM

The webplayer does not block socket communications with localhost. I've noticed some oddities with Security.PrefetchSocketPolicy(host,port). Another thing to check is to make sure the SockPol server is listening to the right protocol (IPv4, IPv6, or both/wildcard). If you have an IPv6 enabled windows machine 'localhost' can get the IPv6 address before the IPv4 and the SockPol may only be listening to the IPv4 address (127.0.0.1). Possible solutions: 1: explicitly call out 127.0.0.1 2: make sure sockpol listens to IPv4 and IPv6 3: Use the Socket.Connect(EndPoint) method which generally bypasses the unity webplayer security sandbox -- I've used this w/o needing to fetch a security policy. 4: Create a java applet which runs a sockpol server on a high port, embed it in your webpage and fetch socket policy from it.

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

1 Person is following this question.

avatar image

Related Questions

Web Player connection issue. 0 Answers

Security.PrefetchSocketPolicy problem. 0 Answers

TCPClient and SslStreams in WebPlayer (C#) 0 Answers

How connect from Unity WebPlayer app to C# server 1 Answer

Socket IO server 1 Answer


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