Quote : http://blogs.unity3d.com/2014/04/29/on-the-future-of-web-publishing-in-unity/ "WebGL in Unity 5.0
We plan to WebGL support available in Unity 5.0 as an early-access add-on. Early-Access means that it will be capable of publishing content to WebGL (like the examples above), but it will have some limitations in features and in browser compatibility. In particular, the following features will not be supported:
Networking other then WWW class (a WebSockets plug-in is available)"
I’m searching for websockets plugin in unity5.0.9beta. Could unity shed some lights on the unity websockets plugin availability in unity5 ? thank you!
I did not look into your implementation, but just in case people are interested: Websockify is a great tool when you need websockets client to connect to existing IP services (by implementing a bridge from WebSockets ↔ IP). We use the same for the profiler connection to the unity editor in WebGL.
ya, I’ve been talking briefly with Photon’s Tobias about their early access WebGL support and its a slow process, don’t think they have much support right now either.
Hi! I get the same error as ortin above when testing the Echotest WebGL build in localhost (Unity 5 b20) - any help would be much appreciated:
Error during WebSocket handshake: Sent non-empty 'Sec-WebSocket-Protocol' header but no response was received
WebSocket is already in CLOSING or CLOSED state.
Error: Abnormal disconnection.
But then as @Osterion mentioned, for WebGL builds it could be just easier to use the javascript client right? Is there any value in using C# and then converting it back into JS?
I don’t think you cam use socket connections from within unity webgl. So by JavaScript, I think you need to use actual JavaScript on your host page and proxy between webgl and the JavaScript. So c# would be out as well, at least as far as directly utilizing websockets.